[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Mar 9 15:37:59 UTC 2019


 sw/source/filter/ww8/wrtw8nds.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 08e78bc7705042d896f0d7c1eddff81d14c35d56
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Fri Jan 25 19:23:38 2019 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Sat Mar 9 16:37:35 2019 +0100

    tdf#98620 filter\ww8 export: spam bidi=LTR also
    
    If the AppLanguage is RTL, then it is likely that paragraph
    styles inheriting from the environment will export as RTL.
    So, if the paragraph is LTR (from a page style for example),
    then it needs to be specified in order to override the paragraph style.
    So, this is not just for RTL, even if it is a default value.
    
    Exactly what the paragraph style will become is complicated, and
    not necessarily the same across the different formats. Thus it
    is safest to just spam the bidi attributes across any questionable
    paragraphs.
    
    A followup commit will similarly spam Justify in these situations,
    and again the difference between doc and docx suggests it is
    better to spam more, rather than less.
    
    Change-Id: Id184a983675b147f051821e828583a4bf98b3211
    Reviewed-on: https://gerrit.libreoffice.org/66922
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 9559ef9d0400..b73fe1754c1f 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2749,14 +2749,16 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
                 rNode.GetSwAttrSet().GetItem(RES_FRAMEDIR);
             if (
                 (!pItem || pItem->GetValue() == SvxFrameDirection::Environment) &&
-                rTextColl.GetFrameDir().GetValue() == SvxFrameDirection::Environment &&
-                aAttrIter.IsParaRTL()
+                rTextColl.GetFrameDir().GetValue() == SvxFrameDirection::Environment
                )
             {
                 if ( !pTmpSet )
                     pTmpSet = new SfxItemSet(rNode.GetSwAttrSet());
 
-                pTmpSet->Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_RL_TB, RES_FRAMEDIR));
+                if ( bParaRTL )
+                    pTmpSet->Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_RL_TB, RES_FRAMEDIR));
+                else
+                    pTmpSet->Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR));
             }
             // move code for handling of numbered,
             // but not counted paragraphs to this place. Otherwise, the paragraph


More information about the Libreoffice-commits mailing list