[Libreoffice-commits] core.git: sc/source

Noel (via logerrit) logerrit at kemper.freedesktop.org
Sat Nov 28 08:03:33 UTC 2020


 sc/source/filter/xml/xmltabi.cxx |   50 +++++++++++----------------------------
 sc/source/filter/xml/xmltabi.hxx |    4 ---
 2 files changed, 15 insertions(+), 39 deletions(-)

New commits:
commit aabdd3a4393df9d6a354783d8c981ce9ca1b1a6c
Author:     Noel <noelgrandin at gmail.com>
AuthorDate: Fri Nov 27 15:15:10 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Nov 28 09:02:55 2020 +0100

    fastparser in ScXMLTableContext
    
    Change-Id: I078d9f3eb4c21924d2dfe9b4e0ce953c3a8ecce8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106773
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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;


More information about the Libreoffice-commits mailing list