diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-03-08 20:03:35 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-03-15 10:15:57 +0100 |
commit | 9bc6160e0acbc78be998129ea55ed7e4529959fa (patch) | |
tree | d07f099dbf264a24c4d291997637fc49d5ebbf96 /sw/source/filter/xml/wrtxml.cxx | |
parent | bfa320ef2ac7ab9a84f86eee6dfa7f3ee67fa630 (diff) |
tdf#133487 sw ODF export: reorder flys' ZOrder/z-index...
... so background shapes have lower z-index than foreground shapes,
as is recommended by ODF 1.3.
Also let SdrObjList::sort() record Undo actions, because earlier Undo
actions could expect the previous sort order.
Change-Id: Idbecf0a2acd525d42efc0ac92677b1c7987cc6ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112180
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source/filter/xml/wrtxml.cxx')
-rw-r--r-- | sw/source/filter/xml/wrtxml.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 4ae5964a7d2e..288814017c25 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/task/XStatusIndicator.hpp> #include <com/sun/star/xml/sax/Writer.hpp> +#include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/frame/XModule.hpp> @@ -34,6 +35,7 @@ #include <comphelper/propertysetinfo.hxx> #include <vcl/errinf.hxx> #include <sal/log.hxx> +#include <o3tl/any.hxx> #include <svx/xmlgrhlp.hxx> #include <svx/xmleohlp.hxx> #include <unotools/saveopt.hxx> @@ -52,6 +54,7 @@ #include <docstat.hxx> #include <docsh.hxx> +#include <xmloff/shapeexport.hxx> #include <unotools/ucbstreamhelper.hxx> #include <swerror.h> #include "wrtxml.hxx" @@ -180,6 +183,15 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS SvtSaveOptions aSaveOpt; xInfoSet->setPropertyValue( "UsePrettyPrinting", makeAny(aSaveOpt.IsPrettyPrinting()) ); + uno::Reference<lang::XComponent> const xModelComp(m_pDoc->GetDocShell()->GetModel()); + uno::Reference<drawing::XDrawPageSupplier> const xDPS(xModelComp, uno::UNO_QUERY); + assert(xDPS.is()); + xmloff::FixZOrder(xDPS->getDrawPage(), + [](uno::Reference<beans::XPropertySet> const& xShape) + { + return !*o3tl::doAccess<bool>(xShape->getPropertyValue("Opaque")); + }); + // save show redline mode ... RedlineFlags const nOrigRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags(); RedlineFlags nRedlineFlags(nOrigRedlineFlags); @@ -248,12 +260,6 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS if( xStatusIndicator.is() ) *pArgs++ <<= xStatusIndicator; - //Get model - uno::Reference< lang::XComponent > xModelComp = m_pDoc->GetDocShell()->GetModel(); - OSL_ENSURE( xModelComp.is(), "XMLWriter::Write: got no model" ); - if( !xModelComp.is() ) - return ERR_SWG_WRITE_ERROR; - PutNumFormatFontsInAttrPool(); PutEditEngFontsInAttrPool(); |