summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-05-07 18:18:43 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2020-07-22 14:16:00 +0200
commit9fc50174545bbb9968b47ca200da2816f45e72a1 (patch)
treec69881d6b47cddf7c25c67f62e98c940b7541ae8 /include
parentb65d956ecec1fc1acc2e037f426f3485d7b8fa0e (diff)
tdf#103602 xmloff,sw: ODF 1.3 import: PageStyle with drawing-page style
Associate a style of family "drawing-page" with a style:master-page. This fixes the small part of the draw:fill attribute problem that is covered by OFFICE-3937 in ODF 1.3. This is the import part. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93670 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 4e98ba4ba5c17ab8ae1170662af645b9d2bfde84) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94587 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit ca9a719169fa444b5d82942ae1d5600fa0114002) Change-Id: I4c86fa24c36407b64ce33f0890e5da8c26c5292a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99156 Tested-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'include')
-rw-r--r--include/xmloff/PageMasterStyleMap.hxx1
-rw-r--r--include/xmloff/XMLDrawingPageStyleContext.hxx44
-rw-r--r--include/xmloff/XMLTextMasterPageContext.hxx6
-rw-r--r--include/xmloff/prstylei.hxx4
-rw-r--r--include/xmloff/txtimp.hxx2
5 files changed, 56 insertions, 1 deletions
diff --git a/include/xmloff/PageMasterStyleMap.hxx b/include/xmloff/PageMasterStyleMap.hxx
index 2b6a1b373768..93ec45b52362 100644
--- a/include/xmloff/PageMasterStyleMap.hxx
+++ b/include/xmloff/PageMasterStyleMap.hxx
@@ -187,6 +187,7 @@
#define CTF_PM_FTN_LINE_STYLE (XML_PM_CTF_START + 0x0067)
extern const XMLPropertyMapEntry aXMLPageMasterStyleMap[];
+extern const XMLPropertyMapEntry g_XMLPageMasterDrawingPageStyleMap[];
extern const XMLPropertyMapEntry aXMLPageMasterHeaderImportStyleMap[];
extern const XMLPropertyMapEntry aXMLPageMasterFooterImportStyleMap[];
diff --git a/include/xmloff/XMLDrawingPageStyleContext.hxx b/include/xmloff/XMLDrawingPageStyleContext.hxx
new file mode 100644
index 000000000000..d0593b408976
--- /dev/null
+++ b/include/xmloff/XMLDrawingPageStyleContext.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <xmloff/prstylei.hxx>
+#include <xmloff/xmlimppr.hxx>
+#include <xmloff/families.hxx>
+#include <xmloff/dllapi.h>
+
+class XMLOFF_DLLPUBLIC XMLDrawingPageStyleContext : public XMLPropStyleContext
+{
+public:
+ XMLDrawingPageStyleContext(SvXMLImport& rImport, sal_uInt16 nPrefix, OUString const& rLocalName,
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrList,
+ SvXMLStylesContext& rStyles,
+ ContextID_Index_Pair const pContextIDs[],
+ sal_uInt16 const pFamilies[]);
+
+ virtual void
+ FillPropertySet(css::uno::Reference<css::beans::XPropertySet> const& rPropSet) override;
+
+private:
+ std::unique_ptr<ContextID_Index_Pair[]> m_pContextIDs;
+ sal_uInt16 const* const m_pFamilies;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLTextMasterPageContext.hxx b/include/xmloff/XMLTextMasterPageContext.hxx
index eab02ed18899..4580de105bf2 100644
--- a/include/xmloff/XMLTextMasterPageContext.hxx
+++ b/include/xmloff/XMLTextMasterPageContext.hxx
@@ -35,6 +35,7 @@ class XMLOFF_DLLPUBLIC XMLTextMasterPageContext : public SvXMLStyleContext
const OUString sFollowStyle;
OUString sFollow;
OUString sPageMasterName;
+ OUString m_sDrawingPageStyle;
css::uno::Reference < css::style::XStyle > xStyle;
@@ -75,6 +76,11 @@ public:
virtual void Finish( bool bOverwrite ) override;
};
+struct ContextID_Index_Pair;
+
+XMLOFF_DLLPUBLIC extern ContextID_Index_Pair const g_MasterPageContextIDs[];
+XMLOFF_DLLPUBLIC extern sal_uInt16 const g_MasterPageFamilies[];
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/prstylei.hxx b/include/xmloff/prstylei.hxx
index 1fbda3c11f77..50d41c6a4183 100644
--- a/include/xmloff/prstylei.hxx
+++ b/include/xmloff/prstylei.hxx
@@ -49,13 +49,15 @@ private:
XMLPropStyleContext(XMLPropStyleContext &) = delete;
void operator =(XMLPropStyleContext &) = delete;
-protected:
+public:
// Helper to check if the local maProperties contains the given
// FillStyle tag and if the FillStyle there is different from FillStyle_NONE
bool doNewDrawingLayerFillStyleDefinitionsExist(
const ::rtl::OUString& rFillStyleTag) const;
+protected:
+
// Helper which will deactivate all old fill definitions (identified by
// the given OldFillStyleDefinitionSet) in the local maProperties. Deactivation
// is done setting theindex to -1. It returns true when actually old fill
diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
index 287413ba7f5c..0073f92f21da 100644
--- a/include/xmloff/txtimp.hxx
+++ b/include/xmloff/txtimp.hxx
@@ -505,6 +505,7 @@ public:
const OUString& rName ) const;
XMLPropStyleContext* FindPageMaster(
const OUString& rName ) const;
+ XMLPropStyleContext* FindDrawingPage(OUString const& rName) const;
const css::uno::Reference< css::container::XNameContainer> & GetParaStyles() const;
@@ -547,6 +548,7 @@ public:
static SvXMLImportPropertyMapper* CreateTableDefaultExtPropMapper(SvXMLImport&);
static SvXMLImportPropertyMapper* CreateTableRowDefaultExtPropMapper(SvXMLImport&);
static SvXMLImportPropertyMapper* CreateTableCellExtPropMapper(SvXMLImport&);
+ static SvXMLImportPropertyMapper* CreateDrawingPageExtPropMapper(SvXMLImport&);
SvI18NMap& GetRenameMap();