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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Aug 11 05:26:55 UTC 2018


 writerfilter/source/dmapper/DomainMapper.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d5bee2ea364427cafc90cd4fa8e63f27c09e10a3
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Fri Aug 10 15:08:00 2018 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Sat Aug 11 07:26:33 2018 +0200

    writerfilter: ensure bidi has expected value
    
    In case the document has an unexpectedly high positive value for
    bidi, don't let that mess up the logic.
    
    Change-Id: I133dbec738a7503dff49b2af6d1a35b2f7754a9d
    Reviewed-on: https://gerrit.libreoffice.org/58827
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 7b45cf36b865..7df19fb9790f 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1457,11 +1457,12 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
             // 3.) previous adjust and bidi different from previous: swap adjusts
             // 4.) previous adjust and no previous bidi: RTL swaps adjust
 
+            const sal_Int16 nWritingMode = nIntValue ? text::WritingMode2::RL_TB : text::WritingMode2::LR_TB;
             sal_Int16 nParentBidi = -1;
             m_pImpl->GetPropertyFromStyleSheet(PROP_WRITING_MODE) >>= nParentBidi;
             // Paragraph justification reverses its meaning in an RTL context.
             // 1. Only make adjustments if the BiDi changes.
-            if ( nParentBidi != nIntValue && !IsRTFImport() )
+            if ( nParentBidi != nWritingMode && !IsRTFImport() )
             {
                 style::ParagraphAdjust eAdjust = style::ParagraphAdjust(-1);
                 // 2. no adjust property exists yet
@@ -1480,7 +1481,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
                         rContext->Insert(PROP_PARA_ADJUST, uno::makeAny( style::ParagraphAdjust_RIGHT ));
                 }
             }
-            sal_Int16 nWritingMode = nIntValue ? text::WritingMode2::RL_TB : text::WritingMode2::LR_TB;
             rContext->Insert(PROP_WRITING_MODE, uno::makeAny( nWritingMode ));
         }
 


More information about the Libreoffice-commits mailing list