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@sil.org>
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 9559ef9..b73fe17 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2749,14 +2749,16 @@
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