diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-05-15 17:10:00 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-05-15 18:41:58 +0200 |
commit | da9bb77e99fede9f7e67b42f1d3ed9b4f235755c (patch) | |
tree | c0f5498f139b9fa5566dc8e8a6681b449bc39d76 /xmloff | |
parent | 3905bd92b038374d22e4ff9f74480decb116d727 (diff) |
i#119922: reverse engineer 9a37613b5e8f08fae585d54a5745e887eb08f8ce
It is not quite obvious what that commit attempts to do... especially
since the bugdoc attachment does not actually exercise the code that was
added in the commit, which changes the handling of the
"IsFollowingTextFlow" property.
The corresponding ODF attribute is style:flow-with-text, which has been
added in OOo 2.0. Investigation revels that MSO's ODF filter does not
support this attribute and acts as if it always had value "false".
The code in FillBaseProperties effectively acts as a default if the
value is not set; the ODF spec does not specify what the default should
be. But when an ODF document was written by MSO, "false" makes more
sense than the previous "true" default. Except when the document is not
ODF but OOoXML format, which indicates it's likely written by OOo 1.x
which did not support the attribute and acts as if it always had value
"true".
The Writer UNO API implementation is however not the right place for
format specific handling, so replace that with an addition to the
function reading the default graphic style that sets the
"IsFollowingTextFlow" property to false as a default, which should
have the same effect because all styles inherit from it.
Note: MSO 2010 Word always writes a default graphic style into ODF docs.
This has a side effect for loaded ODF documents: various newly
inserted objects have the property turned off then. But it turns out
this is actually an advantage, since the same behavior already exists
for _new_ documents (see SwDocShell::InitNew) so it is more consistent
now.
Change-Id: Iba6444a0515fd583398ff052fc5018254da31c30
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/XMLGraphicsDefaultStyle.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx index 761b07005b47..598309d44415 100644 --- a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx +++ b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx @@ -108,6 +108,16 @@ void XMLGraphicsDefaultStyle::SetDefaults() if ( xInfo->hasPropertyByName( sTextWordWrap ) ) xDefaults->setPropertyValue( sTextWordWrap, Any( bWordWrapDefault ) ); + if (!GetImport().IsOOoXML() + && xInfo->hasPropertyByName("IsFollowingTextFlow")) + { + // MSO does not support "style:flow-with-text" so "false" is the better + // default (which may be overridden by the FillPropertySet below). + // Do not do this for OOoXML format: OOo 1.x only supported "true" + // so that is the more appropriate default. + xDefaults->setPropertyValue("IsFollowingTextFlow", uno::makeAny(false)); + } + FillPropertySet( xDefaults ); } |