summaryrefslogtreecommitdiff
path: root/xmloff/source/draw/sdxmlimp.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-21 10:54:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-21 11:09:29 +0100
commit24b0ef899e10e03743cf01f737f1c07167f391ec (patch)
tree8df0383e0a7aace1bcd3091f27bbbe82c89a5683 /xmloff/source/draw/sdxmlimp.cxx
parent2eacc795cf29a61e0561c8acba3168afe7c80be8 (diff)
Use FastParser in SdXMLBodyContext
Change-Id: I1070ca2351f7bfb2e0c10ba6e876ebcf2cae0ce0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87118 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/draw/sdxmlimp.cxx')
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx47
1 files changed, 21 insertions, 26 deletions
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index dfb4bf267ea8..fcf2a179d0f3 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -56,31 +56,27 @@ class SdXMLBodyContext_Impl : public SvXMLImportContext
public:
- SdXMLBodyContext_Impl( SdXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList );
+ SdXMLBodyContext_Impl( SdXMLImport& rImport );
- virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList ) override;
+ virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/,
+ const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {}
+
+ virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
+ sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
};
}
-SdXMLBodyContext_Impl::SdXMLBodyContext_Impl( SdXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList > & ) :
- SvXMLImportContext( rImport, nPrfx, rLName )
+SdXMLBodyContext_Impl::SdXMLBodyContext_Impl( SdXMLImport& rImport ) :
+ SvXMLImportContext( rImport )
{
}
-SvXMLImportContextRef SdXMLBodyContext_Impl::CreateChildContext(
- sal_uInt16 /*nPrefix*/,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/ )
+css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLBodyContext_Impl::createFastChildContext(
+ sal_Int32 /*nElement*/,
+ const uno::Reference< xml::sax::XFastAttributeList > & /*xAttrList*/ )
{
- SvXMLImportContext* pContext = new SdXMLBodyContext(GetSdImport(), rLocalName);
- return pContext;
+ return new SdXMLBodyContext(GetSdImport());
}
namespace {
@@ -164,16 +160,6 @@ SvXMLImportContextRef SdXMLDocContext_Impl::CreateChildContext(
SAL_INFO("xmloff.draw", "XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
break;
}
- case XML_TOK_DOC_BODY:
- {
- if( GetImport().getImportFlags() & SvXMLImportFlags::CONTENT )
- {
- // office:body inside office:document
- xContext = new SdXMLBodyContext_Impl(GetSdImport(),nPrefix,
- rLocalName, xAttrList);
- }
- break;
- }
}
return xContext;
@@ -202,6 +188,15 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SdXMLDocContext_Impl::c
}
break;
}
+ case XML_ELEMENT(OFFICE, XML_BODY):
+ {
+ if( GetImport().getImportFlags() & SvXMLImportFlags::CONTENT )
+ {
+ // office:body inside office:document
+ return new SdXMLBodyContext_Impl(GetSdImport());
+ }
+ break;
+ }
}
return nullptr;
}