[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Feb 23 15:39:10 UTC 2019
sw/source/filter/ww8/wrtw8sty.cxx | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 06742182e5306d6d06e3253981723a69a3c978ab
Author: Justin Luth <justin_luth at sil.org>
AuthorDate: Sat Jan 26 19:09:07 2019 +0300
Commit: Justin Luth <justin_luth at sil.org>
CommitDate: Sat Feb 23 16:38:48 2019 +0100
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 at sil.org>
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"))
{
More information about the Libreoffice-commits
mailing list