diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-05-07 18:18:43 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-05-23 16:30:51 +0200 |
commit | ca9a719169fa444b5d82942ae1d5600fa0114002 (patch) | |
tree | df31f449b817c2cd5ddf9f5572fa20aa6d796a94 /include/xmloff | |
parent | a97cbe7221c0175a4a2d342e2d1a62b06af4e13a (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.
Change-Id: I4c86fa24c36407b64ce33f0890e5da8c26c5292a
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>
Diffstat (limited to 'include/xmloff')
-rw-r--r-- | include/xmloff/PageMasterStyleMap.hxx | 1 | ||||
-rw-r--r-- | include/xmloff/XMLDrawingPageStyleContext.hxx | 44 | ||||
-rw-r--r-- | include/xmloff/XMLTextMasterPageContext.hxx | 6 | ||||
-rw-r--r-- | include/xmloff/prstylei.hxx | 4 | ||||
-rw-r--r-- | include/xmloff/txtimp.hxx | 2 | ||||
-rw-r--r-- | include/xmloff/xmlimppr.hxx | 2 |
6 files changed, 57 insertions, 2 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 70503a5cc631..659ac703ab8f 100644 --- a/include/xmloff/XMLTextMasterPageContext.hxx +++ b/include/xmloff/XMLTextMasterPageContext.hxx @@ -33,6 +33,7 @@ class XMLOFF_DLLPUBLIC XMLTextMasterPageContext : public SvXMLStyleContext { OUString sFollow; OUString sPageMasterName; + OUString m_sDrawingPageStyle; css::uno::Reference < css::style::XStyle > xStyle; @@ -73,6 +74,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 9935176b028c..65a2aa2eea6b 100644 --- a/include/xmloff/prstylei.hxx +++ b/include/xmloff/prstylei.hxx @@ -47,13 +47,15 @@ private: XMLPropStyleContext(XMLPropStyleContext const &) = delete; XMLPropStyleContext& operator =(XMLPropStyleContext const &) = 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 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 db79f9c24dbd..6039d73a412c 100644 --- a/include/xmloff/txtimp.hxx +++ b/include/xmloff/txtimp.hxx @@ -503,6 +503,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; @@ -545,6 +546,7 @@ public: static SvXMLImportPropertyMapper* CreateTableDefaultExtPropMapper(SvXMLImport&); static SvXMLImportPropertyMapper* CreateTableRowDefaultExtPropMapper(SvXMLImport&); static SvXMLImportPropertyMapper* CreateTableCellExtPropMapper(SvXMLImport&); + static SvXMLImportPropertyMapper* CreateDrawingPageExtPropMapper(SvXMLImport&); SvI18NMap& GetRenameMap(); diff --git a/include/xmloff/xmlimppr.hxx b/include/xmloff/xmlimppr.hxx index d77d434b3ab5..de10dd3b7b10 100644 --- a/include/xmloff/xmlimppr.hxx +++ b/include/xmloff/xmlimppr.hxx @@ -53,7 +53,7 @@ class SvXMLImport; */ struct ContextID_Index_Pair { - sal_Int16 const nContextID; + sal_Int16 nContextID; sal_Int32 nIndex; }; |