diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-27 15:15:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-28 09:02:55 +0100 |
commit | aabdd3a4393df9d6a354783d8c981ce9ca1b1a6c (patch) | |
tree | 0c392f7399aac1a783f3e86722106ccde926babc /sc | |
parent | e46be5018d78097f9cd75a36992a2af88652fe4c (diff) |
fastparser in ScXMLTableContext
Change-Id: I078d9f3eb4c21924d2dfe9b4e0ce953c3a8ecce8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106773
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmltabi.cxx | 50 | ||||
-rw-r--r-- | sc/source/filter/xml/xmltabi.hxx | 4 |
2 files changed, 15 insertions, 39 deletions
diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index 7ef701f1baa9..ee09f9de2243 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -209,35 +209,6 @@ ScXMLTableContext::~ScXMLTableContext() { } -SvXMLImportContextRef ScXMLTableContext::CreateChildContext( sal_uInt16 nPrefix, - const OUString& rLName, - const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttrList*/ ) -{ - const SvXMLTokenMap& rTokenMap(GetScImport().GetTableElemTokenMap()); - sal_uInt16 nToken = rTokenMap.Get(nPrefix, rLName); - if (pExternalRefInfo) - { - return new SvXMLImportContext(GetImport(), nPrefix, rLName); - } - - SvXMLImportContext *pContext(nullptr); - - switch (nToken) - { - case XML_TOK_TABLE_FORMS: - { - GetScImport().GetFormImport()->startPage(GetScImport().GetTables().GetCurrentXDrawPage()); - bStartFormPage = true; - pContext = xmloff::OFormLayerXMLImport::createOfficeFormsContext( GetScImport() ); - } - break; - default: - ; - } - - return pContext; -} - uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTableContext::createFastChildContext( sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList > & xAttrList ) @@ -274,12 +245,12 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL switch ( nElement ) { case XML_ELEMENT( TABLE, XML_NAMED_EXPRESSIONS ): - { - SCTAB nTab = GetScImport().GetTables().GetCurrentSheet(); - pContext = new ScXMLNamedExpressionsContext( - GetScImport(), - std::make_shared<ScXMLNamedExpressionsContext::SheetLocalInserter>(GetScImport(), nTab)); - } + { + SCTAB nTab = GetScImport().GetTables().GetCurrentSheet(); + pContext = new ScXMLNamedExpressionsContext( + GetScImport(), + std::make_shared<ScXMLNamedExpressionsContext::SheetLocalInserter>(GetScImport(), nTab)); + } break; case XML_ELEMENT( TABLE, XML_TABLE_COLUMN_GROUP ): pContext = new ScXMLTableColsContext( GetScImport(), pAttribList, @@ -336,6 +307,15 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL pContext = new XMLEventsImportContext( GetImport(), xSupplier ); } break; + case XML_ELEMENT(OFFICE, XML_FORMS): + { + GetScImport().GetFormImport()->startPage(GetScImport().GetTables().GetCurrentXDrawPage()); + bStartFormPage = true; + pContext = xmloff::OFormLayerXMLImport::createOfficeFormsContext( GetScImport() ); + } + break; + default: + XMLOFF_WARN_UNKNOWN_ELEMENT("sc", nElement); } return pContext; diff --git a/sc/source/filter/xml/xmltabi.hxx b/sc/source/filter/xml/xmltabi.hxx index a20959a58e01..9ca691e3e1eb 100644 --- a/sc/source/filter/xml/xmltabi.hxx +++ b/sc/source/filter/xml/xmltabi.hxx @@ -53,10 +53,6 @@ public: virtual ~ScXMLTableContext() 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; |