diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-11-24 20:33:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-25 10:14:50 +0100 |
commit | b3dd7ebdab8015735dd07afdf518500bbc69a1b3 (patch) | |
tree | 3065a483617188cd5ae35895b04e2f833f8ffb90 /xmloff/source | |
parent | 810bb0a96afcc2764ffc62c419343e464a85013a (diff) |
fastparser in XMLIndexTemplateContext
Change-Id: I652ae8e960965c3bfd6183888c039e0e467e030a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106550
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source')
12 files changed, 29 insertions, 56 deletions
diff --git a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx index 343b86dcded3..af5886fe559d 100644 --- a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx @@ -40,13 +40,10 @@ using ::com::sun::star::xml::sax::XAttributeList; XMLIndexBibliographyEntryContext::XMLIndexBibliographyEntryContext( SvXMLImport& rImport, - XMLIndexTemplateContext& rTemplate, - sal_uInt16 nPrfx, - const OUString& rLocalName ) : + XMLIndexTemplateContext& rTemplate ) : XMLIndexSimpleEntryContext(rImport, "TokenBibliographyDataField", - rTemplate, - nPrfx, rLocalName), + rTemplate), nBibliographyInfo(BibliographyDataField::IDENTIFIER), bBibliographyInfoOK(false) { diff --git a/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx b/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx index f364fe4e657e..97546c0759dd 100644 --- a/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx +++ b/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx @@ -48,9 +48,7 @@ public: XMLIndexBibliographyEntryContext( SvXMLImport& rImport, - XMLIndexTemplateContext& rTemplate, - sal_uInt16 nPrfx, - const OUString& rLocalName ); + XMLIndexTemplateContext& rTemplate ); virtual ~XMLIndexBibliographyEntryContext() override; diff --git a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx index 50233bd18ae0..d394a78add77 100644 --- a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx +++ b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx @@ -45,13 +45,11 @@ using ::com::sun::star::xml::sax::XAttributeList; XMLIndexChapterInfoEntryContext::XMLIndexChapterInfoEntryContext( SvXMLImport& rImport, XMLIndexTemplateContext& rTemplate, - sal_uInt16 nPrfx, - const OUString& rLocalName, bool bT ) : XMLIndexSimpleEntryContext(rImport, (bT ? OUString("TokenEntryNumber") : OUString("TokenChapterInfo")), - rTemplate, nPrfx, rLocalName), + rTemplate), nChapterInfo(ChapterFormat::NAME_NUMBER), bChapterInfoOK(false), bTOC( bT ), diff --git a/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx b/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx index 34d750347c33..13608a3b6009 100644 --- a/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx +++ b/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx @@ -49,8 +49,6 @@ public: XMLIndexChapterInfoEntryContext( SvXMLImport& rImport, XMLIndexTemplateContext& rTemplate, - sal_uInt16 nPrfx, - const OUString& rLocalName, bool bTOC ); virtual ~XMLIndexChapterInfoEntryContext() override; diff --git a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx index 51f68b5f54d3..1317331ade71 100644 --- a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx +++ b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx @@ -41,10 +41,8 @@ using ::xmloff::token::XML_STYLE_NAME; XMLIndexSimpleEntryContext::XMLIndexSimpleEntryContext( SvXMLImport& rImport, const OUString& rEntry, - XMLIndexTemplateContext& rTemplate, - sal_uInt16 nPrfx, - const OUString& rLocalName ) -: SvXMLImportContext(rImport, nPrfx, rLocalName) + XMLIndexTemplateContext& rTemplate ) +: SvXMLImportContext(rImport) , m_rEntryType(rEntry) , m_bCharStyleNameOK(false) , m_rTemplateContext(rTemplate) diff --git a/xmloff/source/text/XMLIndexSimpleEntryContext.hxx b/xmloff/source/text/XMLIndexSimpleEntryContext.hxx index 85fcd1b1e5ae..beb816832749 100644 --- a/xmloff/source/text/XMLIndexSimpleEntryContext.hxx +++ b/xmloff/source/text/XMLIndexSimpleEntryContext.hxx @@ -57,9 +57,7 @@ public: XMLIndexSimpleEntryContext( SvXMLImport& rImport, const OUString& rEntry, - XMLIndexTemplateContext& rTemplate, - sal_uInt16 nPrfx, - const OUString& rLocalName ); + XMLIndexTemplateContext& rTemplate ); virtual ~XMLIndexSimpleEntryContext() override; diff --git a/xmloff/source/text/XMLIndexSpanEntryContext.cxx b/xmloff/source/text/XMLIndexSpanEntryContext.cxx index a135d0e292fe..a846674b30b9 100644 --- a/xmloff/source/text/XMLIndexSpanEntryContext.cxx +++ b/xmloff/source/text/XMLIndexSpanEntryContext.cxx @@ -30,11 +30,9 @@ using ::com::sun::star::beans::PropertyValue; XMLIndexSpanEntryContext::XMLIndexSpanEntryContext( SvXMLImport& rImport, - XMLIndexTemplateContext& rTemplate, - sal_uInt16 nPrfx, - const OUString& rLocalName ) : + XMLIndexTemplateContext& rTemplate ) : XMLIndexSimpleEntryContext(rImport, "TokenText", - rTemplate, nPrfx, rLocalName) + rTemplate) { m_nValues++; // one more for the text string } diff --git a/xmloff/source/text/XMLIndexSpanEntryContext.hxx b/xmloff/source/text/XMLIndexSpanEntryContext.hxx index a1cd11713c63..8103cbea699e 100644 --- a/xmloff/source/text/XMLIndexSpanEntryContext.hxx +++ b/xmloff/source/text/XMLIndexSpanEntryContext.hxx @@ -41,9 +41,7 @@ public: XMLIndexSpanEntryContext( SvXMLImport& rImport, - XMLIndexTemplateContext& rTemplate, - sal_uInt16 nPrfx, - const OUString& rLocalName ); + XMLIndexTemplateContext& rTemplate ); virtual ~XMLIndexSpanEntryContext() override; diff --git a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx index 382acdb47198..9c9e195c60fc 100644 --- a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx +++ b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx @@ -41,11 +41,9 @@ using ::com::sun::star::xml::sax::XAttributeList; XMLIndexTabStopEntryContext::XMLIndexTabStopEntryContext( SvXMLImport& rImport, - XMLIndexTemplateContext& rTemplate, - sal_uInt16 nPrfx, - const OUString& rLocalName ) : + XMLIndexTemplateContext& rTemplate ) : XMLIndexSimpleEntryContext(rImport, "TokenTabStop", - rTemplate, nPrfx, rLocalName), + rTemplate), sLeaderChar(), nTabPosition(0), bTabPositionOK(false), diff --git a/xmloff/source/text/XMLIndexTabStopEntryContext.hxx b/xmloff/source/text/XMLIndexTabStopEntryContext.hxx index 9437fa2e7e96..a4f32d9ce28c 100644 --- a/xmloff/source/text/XMLIndexTabStopEntryContext.hxx +++ b/xmloff/source/text/XMLIndexTabStopEntryContext.hxx @@ -49,9 +49,7 @@ public: XMLIndexTabStopEntryContext( SvXMLImport& rImport, - XMLIndexTemplateContext& rTemplate, - sal_uInt16 nPrfx, - const OUString& rLocalName ); + XMLIndexTemplateContext& rTemplate ); virtual ~XMLIndexTabStopEntryContext() override; diff --git a/xmloff/source/text/XMLIndexTemplateContext.cxx b/xmloff/source/text/XMLIndexTemplateContext.cxx index 64d3519e8dc3..2c23fe3227f8 100644 --- a/xmloff/source/text/XMLIndexTemplateContext.cxx +++ b/xmloff/source/text/XMLIndexTemplateContext.cxx @@ -212,17 +212,16 @@ SvXMLEnumMapEntry<TemplateTokenType> const aTemplateTokenTypeMap[] = { XML_TOKEN_INVALID, TemplateTokenType(0) } }; -SvXMLImportContextRef XMLIndexTemplateContext::CreateChildContext( - sal_uInt16 nPrefix, - const OUString& rLocalName, - const Reference<XAttributeList> & /*xAttrList*/ ) +css::uno::Reference< css::xml::sax::XFastContextHandler > XMLIndexTemplateContext::createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) { SvXMLImportContext* pContext = nullptr; - if (XML_NAMESPACE_TEXT == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix) + if (IsTokenInNamespace(nElement, XML_NAMESPACE_TEXT) || IsTokenInNamespace(nElement, XML_NAMESPACE_LO_EXT)) { TemplateTokenType nToken; - if (SvXMLUnitConverter::convertEnum(nToken, rLocalName, + if (SvXMLUnitConverter::convertEnum(nToken, SvXMLImport::getNameFromToken(nElement), aTemplateTokenTypeMap)) { // can this index accept this kind of token? @@ -232,46 +231,42 @@ SvXMLImportContextRef XMLIndexTemplateContext::CreateChildContext( { case XML_TOK_INDEX_TYPE_ENTRY_TEXT: pContext = new XMLIndexSimpleEntryContext( - GetImport(), "TokenEntryText", *this, - nPrefix, rLocalName); + GetImport(), "TokenEntryText", *this); break; case XML_TOK_INDEX_TYPE_PAGE_NUMBER: pContext = new XMLIndexSimpleEntryContext( - GetImport(), "TokenPageNumber", *this, - nPrefix, rLocalName); + GetImport(), "TokenPageNumber", *this); break; case XML_TOK_INDEX_TYPE_LINK_START: pContext = new XMLIndexSimpleEntryContext( - GetImport(), "TokenHyperlinkStart", *this, - nPrefix, rLocalName); + GetImport(), "TokenHyperlinkStart", *this); break; case XML_TOK_INDEX_TYPE_LINK_END: pContext = new XMLIndexSimpleEntryContext( - GetImport(), "TokenHyperlinkEnd", *this, - nPrefix, rLocalName); + GetImport(), "TokenHyperlinkEnd", *this); break; case XML_TOK_INDEX_TYPE_TEXT: pContext = new XMLIndexSpanEntryContext( - GetImport(), *this, nPrefix, rLocalName); + GetImport(), *this); break; case XML_TOK_INDEX_TYPE_TAB_STOP: pContext = new XMLIndexTabStopEntryContext( - GetImport(), *this, nPrefix, rLocalName); + GetImport(), *this); break; case XML_TOK_INDEX_TYPE_BIBLIOGRAPHY: pContext = new XMLIndexBibliographyEntryContext( - GetImport(), *this, nPrefix, rLocalName); + GetImport(), *this); break; case XML_TOK_INDEX_TYPE_CHAPTER: pContext = new XMLIndexChapterInfoEntryContext( - GetImport(), *this, nPrefix, rLocalName, bTOC ); + GetImport(), *this, bTOC ); break; default: diff --git a/xmloff/source/text/XMLIndexTemplateContext.hxx b/xmloff/source/text/XMLIndexTemplateContext.hxx index a086829fd6ef..b1a5ede7eab9 100644 --- a/xmloff/source/text/XMLIndexTemplateContext.hxx +++ b/xmloff/source/text/XMLIndexTemplateContext.hxx @@ -117,10 +117,9 @@ protected: virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; - virtual SvXMLImportContextRef CreateChildContext( - sal_uInt16 nPrefix, - const OUString& rLocalName, - const css::uno::Reference<css::xml::sax::XAttributeList> & xAttrList ) override; + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override; }; #endif |