summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammad Haggag <mhaggag@gmail.com>2012-02-01 20:56:12 +0200
committerMichael Stahl <mstahl@redhat.com>2012-07-05 22:39:10 +0200
commit0fe856fdbf7696b00ed3fe32890cdb0f7e46c9a5 (patch)
tree8abbec295ab3daaaaecf116e7df795d00a145d53
parent33de264435f2f9a92b27222d33c35d85d5c64167 (diff)
fdo#43398: dmapper: Switch paragraphs to RTL based on the value of w:BiDi.
This is a fix for 43398: FORMATTING: Documents opened in LibreOffice Writer incorrectly appear as right justified. Cause: dmapper used to treat the presence of a w:BiDi element in a paragraph's properties as an indicator of RTL directionality, which is incorrect. A w:BiDi element may have a value of 0, indicating LTR. Fix: Inspect the integral value of w:BiDi elements before switching to RTL. (cherry picked from commit d8cb61f5f32247a8bbaf89fb910c015b6107f051) Change-Id: Id948d9fc9dfb818a502b9de283ac265d0c80cb37 Signed-off-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index c2820eedf947..24cb35336452 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1837,8 +1837,13 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
}
break; // sprmPOutLvl
case NS_sprm::LN_PFBiDi:
- rContext->Insert(PROP_WRITING_MODE, false, uno::makeAny( text::WritingMode2::RL_TB ));
- rContext->Insert(PROP_PARA_ADJUST, false, uno::makeAny( style::ParagraphAdjust_RIGHT ));
+ {
+ if (nIntValue != 0)
+ {
+ rContext->Insert(PROP_WRITING_MODE, false, uno::makeAny( text::WritingMode2::RL_TB ));
+ rContext->Insert(PROP_PARA_ADJUST, false, uno::makeAny( style::ParagraphAdjust_RIGHT ));
+ }
+ }
break; // sprmPFBiDi
case NS_ooxml::LN_EG_SectPrContents_bidi: