diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-20 16:14:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-21 08:21:29 +0100 |
commit | 5a73d3908c30c898a0f21208810332d36657adee (patch) | |
tree | 7d1272ebb7af29a0773a06ddf4ea092e87860c49 /sw/source/filter | |
parent | acb8d7d0568352bb34e869880c6ef44336f63b6f (diff) |
use FastParser in XMLScriptContext
Change-Id: I7c5f5b77a78307c556ee5718480346ed3dd159fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87075
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimp.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlscript.cxx | 5 |
3 files changed, 10 insertions, 8 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 9f56a8f2fb06..d2ff23ec00d6 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -211,8 +211,14 @@ SwXMLDocContext_Impl::SwXMLDocContext_Impl( SwXMLImport& rImport ) : } uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SwXMLDocContext_Impl::createFastChildContext( - sal_Int32 /*nElement*/, const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ ) + sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ ) { + switch (nElement) + { + case XML_ELEMENT(OFFICE, XML_SCRIPTS): + return GetSwImport().CreateScriptContext(); + break; + } return nullptr; } @@ -251,9 +257,6 @@ SvXMLImportContextRef SwXMLDocContext_Impl::CreateChildContext( case XML_TOK_DOC_META: OSL_FAIL("XML_TOK_DOC_META: should not have come here, maybe document is invalid?"); break; - case XML_TOK_DOC_SCRIPT: - pContext = GetSwImport().CreateScriptContext( rLocalName ); - break; case XML_TOK_DOC_BODY: GetSwImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP ); pContext = new SwXMLBodyContext_Impl( GetSwImport(), nPrefix, diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx index 986b4a99bea9..b8357b88eaec 100644 --- a/sw/source/filter/xml/xmlimp.hxx +++ b/sw/source/filter/xml/xmlimp.hxx @@ -134,7 +134,7 @@ public: // NB: in contrast to other CreateFooContexts, this particular one handles // the root element (i.e. office:document-meta) SvXMLImportContext *CreateMetaContext( const sal_Int32 nElement ); - SvXMLImportContext *CreateScriptContext( const OUString& rLocalName ); + SvXMLImportContext *CreateScriptContext(); SvXMLImportContext *CreateStylesContext( const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, diff --git a/sw/source/filter/xml/xmlscript.cxx b/sw/source/filter/xml/xmlscript.cxx index aa54efa5dc5a..a0bd5096f356 100644 --- a/sw/source/filter/xml/xmlscript.cxx +++ b/sw/source/filter/xml/xmlscript.cxx @@ -24,14 +24,13 @@ using namespace ::com::sun::star; -SvXMLImportContext *SwXMLImport::CreateScriptContext( - const OUString& rLocalName ) +SvXMLImportContext *SwXMLImport::CreateScriptContext() { SvXMLImportContext *pContext = nullptr; if( !(IsStylesOnlyMode() || IsInsertMode()) ) { - pContext = new XMLScriptContext( *this, rLocalName, GetModel() ); + pContext = new XMLScriptContext( *this, GetModel() ); } return pContext; |