summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-05-28 17:17:26 +0200
committerJan Holesovsky <kendy@collabora.com>2021-01-07 16:32:56 +0100
commitd164ef07898220938051e9d224de85f998dbe2d5 (patch)
treec326a8613f9eadf6b337c09b3cf041eaf46f297a /xmloff
parent03f5747ff6d8fb72693f4e9c5a23c84a08324644 (diff)
tdf#103602 xmloff: ODF export of page style: don't export draw:fill
... attributes on page-layout-properties in strict ODF. Change-Id: Id7c440bf86f78f5f8bb95b9463874787372d5ae8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95053 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/XMLBackgroundImageExport.hxx4
-rw-r--r--xmloff/source/style/PageMasterExportPropMapper.cxx15
2 files changed, 17 insertions, 2 deletions
diff --git a/xmloff/inc/XMLBackgroundImageExport.hxx b/xmloff/inc/XMLBackgroundImageExport.hxx
index 222f875a709b..affda2766c73 100644
--- a/xmloff/inc/XMLBackgroundImageExport.hxx
+++ b/xmloff/inc/XMLBackgroundImageExport.hxx
@@ -33,10 +33,10 @@ class XMLBackgroundImageExport
{
SvXMLExport& rExport;
- SvXMLExport& GetExport() { return rExport; }
-
public:
+ SvXMLExport& GetExport() const { return rExport; }
+
XMLBackgroundImageExport( SvXMLExport& rExport );
~XMLBackgroundImageExport();
diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx
index d364ebc9f796..7254892fbefe 100644
--- a/xmloff/source/style/PageMasterExportPropMapper.cxx
+++ b/xmloff/source/style/PageMasterExportPropMapper.cxx
@@ -20,6 +20,7 @@
#include "PageMasterExportPropMapper.hxx"
#include <xmloff/xmlprmap.hxx>
#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlexp.hxx>
#include <comphelper/types.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
@@ -331,6 +332,9 @@ void XMLPageMasterExportPropMapper::ContextFilter(
rtl::Reference < XMLPropertySetMapper > aPropMapper(getPropertySetMapper());
+ // distinguish 2 cases: drawing-page export has CTF_PM_FILL, page-layout-properties export does not
+ bool const isDrawingPageExport(aPropMapper->FindEntryIndex(CTF_PM_FILL) != -1);
+
for( auto& rProp : rPropState )
{
XMLPropertyState *pProp = &rProp;
@@ -339,6 +343,17 @@ void XMLPageMasterExportPropMapper::ContextFilter(
sal_Int16 nSimpleId = nContextId & (~CTF_PM_FLAGMASK | XML_PM_CTF_START);
sal_Int16 nPrintId = nContextId & CTF_PM_PRINTMASK;
+
+ // tdf#103602 don't export draw:fill attributes on page-layout-properteis in strict ODF
+ if (!isDrawingPageExport
+ && aPropMapper->GetEntryAPIName(rProp.mnIndex).startsWith("Fill")
+ && ((aBackgroundImageExport.GetExport().getSaneDefaultVersion()
+ & SvtSaveOptions::ODFSVER_EXTENDED) == 0))
+ {
+ lcl_RemoveState(&rProp);
+ continue;
+ }
+
XMLPropertyStateBuffer* pBuffer;
switch( nFlag )
{