From 9bc6160e0acbc78be998129ea55ed7e4529959fa Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 8 Mar 2021 20:03:35 +0100 Subject: 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 --- sw/source/filter/xml/wrtxml.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'sw/source/filter/xml/wrtxml.cxx') 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 #include #include +#include #include #include #include @@ -34,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -52,6 +54,7 @@ #include #include +#include #include #include #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 const xModelComp(m_pDoc->GetDocShell()->GetModel()); + uno::Reference const xDPS(xModelComp, uno::UNO_QUERY); + assert(xDPS.is()); + xmloff::FixZOrder(xDPS->getDrawPage(), + [](uno::Reference const& xShape) + { + return !*o3tl::doAccess(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(); -- cgit