diff options
author | Justin Luth <justin_luth@sil.org> | 2019-01-26 19:09:07 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2019-02-23 16:38:48 +0100 |
commit | 06742182e5306d6d06e3253981723a69a3c978ab (patch) | |
tree | 347102ce49a7e69c81c65dbf7b16dbbf4fdd697a /sw | |
parent | 28885e0764df296aeafbda21ba24341f06f16eb9 (diff) |
tdf#116404 filter\ww8: use bidi for default style in RTL locale
A new document uses the default value of ::Environment for the
RES_FRAMEDIR property. On export, of course a default value does
nothing, and for MS formats a nothing means LTR, even though
in Writer the styles setting was determined by the Locale. So RTL
users were finding their new documents switch to LTR style values
when round-tripping to MS formats.
Since this is properly handled when the property is ::SET (as it normally
is when a document is imported), make sure the the default paragraph
style's RES_FRAMEDIR is ::SET, and the export should take care of it.
This works out of the box for DOCX. The export for the other
formats needs a bit of extra tweaking in addition to this
general patch. The tweaking will be done separately.
Change-Id: I5134a636ee3374bb2c1081fd0f3f6d9e79634cd3
Reviewed-on: https://gerrit.libreoffice.org/66964
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index e41b5fa51ed9..7a3afc42ebd5 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -43,6 +43,7 @@ #include <ndtxt.hxx> #include <ftninfo.hxx> #include <fmthdft.hxx> +#include <frmatr.hxx> #include <section.hxx> #include <fmtcntnt.hxx> #include <fmtftn.hxx> @@ -597,6 +598,10 @@ void MSWordStyles::OutputStyle( SwFormat* pFormat, sal_uInt16 nPos ) { assert( pFormat->GetPoolFormatId() == RES_POOLCOLL_STANDARD ); aName = "Normal"; + + // force bidi property to be SET, so that it exports an appropriate locale value + if ( SfxItemState::SET != pFormat->GetItemState(RES_FRAMEDIR, false) ) + pFormat->SetFormatAttr(pFormat->GetFrameDir()); } else if (aName.equalsIgnoreAsciiCase("Normal")) { |