diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-12-07 17:11:18 +0300 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-12-19 20:55:43 +0100 |
commit | 4b5aaa9edfd58ec8f73de127410656f884f944d7 (patch) | |
tree | 930cf411814e80493da7f8f1d35de3c6e871b685 /sw/source/filter | |
parent | 1e7b134a5d81ec41902552f24243444c6bf542d2 (diff) |
tdf#82802 sw conditional style conditions not saved for TextBody
Someone thought it would be a good idea for the
built-in paragraph style Text Body to be special
and support conditional formatting.
It has been broken for import/export since 2015.
It was mostly fixed in duplicate issue tdf#103091,
but the side case of Text Body was missed.
Partially reverting commit a5b4cb3f836c991d0647f55e1ef4920ce6115eac.
xNewStyle didn't need to be a member variable
since it is assigned to GetStyle anyway.
Change-Id: I102d86c0b1f28e42b2c1350abc247b6b1f8acd4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107352
Tested-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/xml/xmlfmt.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index eb2707ac8013..ad82cb3ba14d 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -257,7 +257,6 @@ namespace { class SwXMLTextStyleContext_Impl : public XMLTextStyleContext { std::unique_ptr<SwXMLConditions_Impl> pConditions; - uno::Reference < style::XStyle > xNewStyle; protected: @@ -279,7 +278,7 @@ public: uno::Reference < style::XStyle > SwXMLTextStyleContext_Impl::Create() { - + uno::Reference < style::XStyle > xNewStyle; if( pConditions && XmlStyleFamily::TEXT_PARAGRAPH == GetFamily() ) { uno::Reference< lang::XMultiServiceFactory > xFactory( GetImport().GetModel(), @@ -303,12 +302,11 @@ uno::Reference < style::XStyle > SwXMLTextStyleContext_Impl::Create() void SwXMLTextStyleContext_Impl::Finish( bool bOverwrite ) { - - if( pConditions && XmlStyleFamily::TEXT_PARAGRAPH == GetFamily() && xNewStyle.is() ) + if( pConditions && XmlStyleFamily::TEXT_PARAGRAPH == GetFamily() && GetStyle().is() ) { CommandStruct const*const pCommands = SwCondCollItem::GetCmds(); - Reference< XPropertySet > xPropSet( xNewStyle, UNO_QUERY ); + Reference< XPropertySet > xPropSet( GetStyle(), UNO_QUERY ); uno::Sequence< beans::NamedValue > aSeq( pConditions->size() ); |