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

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: 's avatarJustin Luth <justin_luth@sil.org>
üst 28885e07
......@@ -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"))
{
......
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