Kaydet (Commit) d5bee2ea authored tarafından Justin Luth's avatar Justin Luth

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: 's avatarJustin Luth <justin_luth@sil.org>
üst d54861ba
...@@ -1457,11 +1457,12 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) ...@@ -1457,11 +1457,12 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
// 3.) previous adjust and bidi different from previous: swap adjusts // 3.) previous adjust and bidi different from previous: swap adjusts
// 4.) previous adjust and no previous bidi: RTL swaps adjust // 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; sal_Int16 nParentBidi = -1;
m_pImpl->GetPropertyFromStyleSheet(PROP_WRITING_MODE) >>= nParentBidi; m_pImpl->GetPropertyFromStyleSheet(PROP_WRITING_MODE) >>= nParentBidi;
// Paragraph justification reverses its meaning in an RTL context. // Paragraph justification reverses its meaning in an RTL context.
// 1. Only make adjustments if the BiDi changes. // 1. Only make adjustments if the BiDi changes.
if ( nParentBidi != nIntValue && !IsRTFImport() ) if ( nParentBidi != nWritingMode && !IsRTFImport() )
{ {
style::ParagraphAdjust eAdjust = style::ParagraphAdjust(-1); style::ParagraphAdjust eAdjust = style::ParagraphAdjust(-1);
// 2. no adjust property exists yet // 2. no adjust property exists yet
...@@ -1480,7 +1481,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) ...@@ -1480,7 +1481,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
rContext->Insert(PROP_PARA_ADJUST, uno::makeAny( style::ParagraphAdjust_RIGHT )); 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 )); rContext->Insert(PROP_WRITING_MODE, uno::makeAny( nWritingMode ));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment