sw/source/filter/ww8/wrtw8nds.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 361abbf803fb77b87bb99d7e69ccec7b920f3418
Author:     Justin Luth <justin_l...@sil.org>
AuthorDate: Fri Jan 25 18:59:26 2019 +0300
Commit:     Justin Luth <justin_l...@sil.org>
CommitDate: Sat Mar 2 17:16:14 2019 +0100

    filter\ww8 export: don't spam RTL if ParaStyle defined
    
    If the paragraph itself inherits BiDi from the environment,
    this just means that it gets the value of the paragraph style.
    If paraStyle is defined, then we don't need to spam the bidi
    property, since it ought to naturally inherit it.
    
    I can only see two possible problems. Either my logic is wrong,
    or else import might not always take the paragraph style
    into account (for determining the meaning of justify for example).
    
    I want to start spamming justify in the case where the BiDi is not
    specified but is inherited from the environment (page style
    or AppLanguage). Separating this into multiple patches
    will help for debugging in case of any regressive tendencies.
    
    related to tdf#98620.
    
    Change-Id: I36bc63e6659a4b491b5c6f2c99c72ba5bb715a07
    Reviewed-on: https://gerrit.libreoffice.org/66921
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_l...@sil.org>

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 0cf9e5a15f56..9559ef9d0400 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2113,8 +2113,9 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
 
     bool bFlyInTable = m_pParentFrame && IsInTable();
 
+    SwTextFormatColl& rTextColl = lcl_getFormatCollection( *this, &rNode );
     if ( !bFlyInTable )
-        m_nStyleBeforeFly = GetId( lcl_getFormatCollection( *this, &rNode ) );
+        m_nStyleBeforeFly = GetId( rTextColl );
 
     // nStyleBeforeFly may change when we recurse into another node, so we
     // have to remember it in nStyle
@@ -2742,11 +2743,13 @@ void MSWordExportBase::OutputTextNode( SwTextNode& 
rNode )
             If a given para is using the SvxFrameDirection::Environment 
direction we
             cannot export that, if it's ltr then that's ok as that is word's
             default. Otherwise we must add a RTL attribute to our export list
+            Only necessary if the ParaStyle doesn't define the direction.
             */
             const SvxFrameDirectionItem* pItem =
                 rNode.GetSwAttrSet().GetItem(RES_FRAMEDIR);
             if (
                 (!pItem || pItem->GetValue() == 
SvxFrameDirection::Environment) &&
+                rTextColl.GetFrameDir().GetValue() == 
SvxFrameDirection::Environment &&
                 aAttrIter.IsParaRTL()
                )
             {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to