diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-25 08:58:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-25 11:18:11 +0200 |
commit | 4070818f586a46a2b572501aca152bb811fa2d5b (patch) | |
tree | 61933e87d1b5529668d1d83bce42bee00a1bef82 | |
parent | 9f514aae04933b6bc677c178e982cabb9be7ab14 (diff) |
use fastparser in PageStyleContext
Change-Id: Iaa433e5c8c5712bbcbef519c613927dbffa22906
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101305
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/xmloff/prstylei.hxx | 4 | ||||
-rw-r--r-- | xmloff/inc/PageMasterImportContext.hxx | 5 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterImportContext.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/style/prstylei.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/style/xmlstyle.cxx | 17 |
5 files changed, 27 insertions, 15 deletions
diff --git a/include/xmloff/prstylei.hxx b/include/xmloff/prstylei.hxx index 42f5c732c423..0bb6243b57f5 100644 --- a/include/xmloff/prstylei.hxx +++ b/include/xmloff/prstylei.hxx @@ -93,6 +93,10 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool bDefaultStyle=false ); + XMLPropStyleContext( SvXMLImport& rImport, sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList, + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, + bool bDefaultStyle=false ); virtual ~XMLPropStyleContext() override; virtual SvXMLImportContextRef CreateChildContext( diff --git a/xmloff/inc/PageMasterImportContext.hxx b/xmloff/inc/PageMasterImportContext.hxx index 66933da8c172..a60522249759 100644 --- a/xmloff/inc/PageMasterImportContext.hxx +++ b/xmloff/inc/PageMasterImportContext.hxx @@ -36,9 +36,8 @@ private: public: - PageStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, - const OUString& rLName, - const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, + PageStyleContext( SvXMLImport& rImport, sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList, SvXMLStylesContext& rStyles, bool bDefaultStyle); virtual ~PageStyleContext() override; diff --git a/xmloff/source/style/PageMasterImportContext.cxx b/xmloff/source/style/PageMasterImportContext.cxx index 3bb1483f1950..8e2caba9eb90 100644 --- a/xmloff/source/style/PageMasterImportContext.cxx +++ b/xmloff/source/style/PageMasterImportContext.cxx @@ -61,11 +61,11 @@ void PageStyleContext::SetAttribute( sal_uInt16 nPrefixKey, PageStyleContext::PageStyleContext( SvXMLImport& rImport, - sal_uInt16 nPrfx, const OUString& rLName, - const uno::Reference< xml::sax::XAttributeList > & xAttrList, + sal_Int32 nElement, + const uno::Reference< xml::sax::XFastAttributeList > & xAttrList, SvXMLStylesContext& rStyles, bool bDefaultStyle) : - XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, XmlStyleFamily::PAGE_MASTER, bDefaultStyle), + XMLPropStyleContext( rImport, nElement, xAttrList, rStyles, XmlStyleFamily::PAGE_MASTER, bDefaultStyle), sPageUsage(), m_bIsFillStyleAlreadyConverted(false) // { diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 02362142ee41..f5389010fb4a 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -156,6 +156,16 @@ XMLPropStyleContext::XMLPropStyleContext( SvXMLImport& rImport, { } +XMLPropStyleContext::XMLPropStyleContext( SvXMLImport& rImport, + sal_Int32 nElement, + const Reference< XFastAttributeList > & xAttrList, + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, + bool bDefault ) +: SvXMLStyleContext( rImport, nElement, xAttrList, nFamily, bDefault ) +, mxStyles( &rStyles ) +{ +} + XMLPropStyleContext::~XMLPropStyleContext() { } diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index 6c4fc1856c0a..73b5236a14c4 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -428,6 +428,14 @@ SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext( pStyle = new XMLLineNumberingImportContext( GetImport(), nElement, xAttrList); break; + case XML_ELEMENT(STYLE, XML_PAGE_LAYOUT): + case XML_ELEMENT(STYLE, XML_DEFAULT_PAGE_LAYOUT): + { + //there is not page family in ODF now, so I specify one for it + bool bDefaultStyle = XML_ELEMENT(STYLE, XML_DEFAULT_PAGE_LAYOUT) == nElement; + pStyle = new PageStyleContext( GetImport(), nElement, xAttrList, *this, bDefaultStyle ); + } + break; // FillStyles @@ -505,15 +513,6 @@ SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext( sal_uInt16 p_nPr rLocalName, xAttrList ); } break; - case XML_TOK_STYLE_PAGE_MASTER: - case XML_TOK_STYLE_DEFAULT_PAGE_LAYOUT: - { - //there is not page family in ODF now, so I specify one for it - bool bDefaultStyle = XML_TOK_STYLE_DEFAULT_PAGE_LAYOUT == nToken; - pStyle = new PageStyleContext( GetImport(), p_nPrefix, - rLocalName, xAttrList, *this, bDefaultStyle ); - } - break; case XML_TOK_TEXT_LIST_STYLE: pStyle = new SvxXMLListStyleContext( GetImport(), p_nPrefix, rLocalName, xAttrList ); |