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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 19 19:59:09 UTC 2020


 xmloff/source/chart/SchXMLPlotAreaContext.cxx              |    4 -
 xmloff/source/chart/SchXMLPlotAreaContext.hxx              |    2 
 xmloff/source/chart/SchXMLPropertyMappingContext.cxx       |    4 -
 xmloff/source/chart/SchXMLPropertyMappingContext.hxx       |    2 
 xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx |    4 -
 xmloff/source/chart/SchXMLRegressionCurveObjectContext.hxx |    2 
 xmloff/source/chart/SchXMLSeries2Context.cxx               |   44 +++++--------
 xmloff/source/chart/SchXMLSeries2Context.hxx               |    7 --
 8 files changed, 27 insertions(+), 42 deletions(-)

New commits:
commit bcd263da24344fd813253ad02390a34f21067dc4
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Wed Nov 18 20:29:47 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Nov 19 20:58:30 2020 +0100

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

diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 1641a516e09c..521fcb58ce41 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -1053,15 +1053,13 @@ static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocume
 SchXMLStatisticsObjectContext::SchXMLStatisticsObjectContext(
     SchXMLImportHelper& rImpHelper,
     SvXMLImport& rImport,
-    sal_uInt16 nPrefix,
-    const OUString& rLocalName,
     const OUString &rSeriesStyleName,
     ::std::vector< DataRowPointStyle >& rStyleVector,
     const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
     ContextType eContextType,
     tSchXMLLSequencesPerIndex & rLSequencesPerIndex) :
 
-        SvXMLImportContext( rImport, nPrefix, rLocalName ),
+        SvXMLImportContext( rImport ),
         mrImportHelper( rImpHelper ),
         mrStyleVector( rStyleVector ),
         m_xSeries( xSeries ),
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
index 7ecf80628734..1e392e8a3b3c 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
@@ -274,8 +274,6 @@ public:
     SchXMLStatisticsObjectContext(
         SchXMLImportHelper& rImportHelper,
         SvXMLImport& rImport,
-        sal_uInt16 nPrefix,
-        const OUString& rLocalName,
         const OUString &rSeriesStyleName,
         ::std::vector< DataRowPointStyle >& rStyleVector,
         const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
diff --git a/xmloff/source/chart/SchXMLPropertyMappingContext.cxx b/xmloff/source/chart/SchXMLPropertyMappingContext.cxx
index aace1e84fd5b..8303d5bd660f 100644
--- a/xmloff/source/chart/SchXMLPropertyMappingContext.cxx
+++ b/xmloff/source/chart/SchXMLPropertyMappingContext.cxx
@@ -61,11 +61,11 @@ Reference< chart2::data::XLabeledDataSequence2 > createAndAddSequenceToSeries( c
 }
 
 SchXMLPropertyMappingContext::SchXMLPropertyMappingContext( SchXMLImportHelper& rImpHelper,
-        SvXMLImport& rImport, const OUString& rLocalName,
+        SvXMLImport& rImport,
         tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
         uno::Reference<
         chart2::XDataSeries > const & xSeries ):
-    SvXMLImportContext( rImport, XML_NAMESPACE_LO_EXT, rLocalName ),
+    SvXMLImportContext( rImport ),
     mrImportHelper( rImpHelper ),
     mxDataSeries(xSeries),
     mrLSequencesPerIndex(rLSequencesPerIndex)
diff --git a/xmloff/source/chart/SchXMLPropertyMappingContext.hxx b/xmloff/source/chart/SchXMLPropertyMappingContext.hxx
index 4206ed91193c..31ae90d3dd3e 100644
--- a/xmloff/source/chart/SchXMLPropertyMappingContext.hxx
+++ b/xmloff/source/chart/SchXMLPropertyMappingContext.hxx
@@ -26,7 +26,7 @@ class SchXMLPropertyMappingContext : public SvXMLImportContext
 public:
 
     SchXMLPropertyMappingContext( SchXMLImportHelper& rImpHelper,
-                          SvXMLImport& rImport, const OUString& rLocalName,
+                          SvXMLImport& rImport,
                           tSchXMLLSequencesPerIndex& rLSequencesPerIndex,
                               css::uno::Reference<
                               css::chart2::XDataSeries > const & xSeries );
diff --git a/xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx b/xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx
index e1ce5b48eb38..ec9253a74058 100644
--- a/xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx
+++ b/xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx
@@ -43,13 +43,11 @@ using namespace xmloff::token;
 SchXMLRegressionCurveObjectContext::SchXMLRegressionCurveObjectContext(
                                         SchXMLImportHelper& rImpHelper,
                                         SvXMLImport& rImport,
-                                        sal_uInt16 nPrefix,
-                                        const OUString& rLocalName,
                                         std::vector< RegressionStyle >& rRegressionStyleVector,
                                         const css::uno::Reference<
                                                     css::chart2::XDataSeries >& xSeries,
                                         const awt::Size & rChartSize) :
-    SvXMLImportContext( rImport, nPrefix, rLocalName ),
+    SvXMLImportContext( rImport ),
     mrImportHelper( rImpHelper ),
     mxSeries( xSeries ),
     maChartSize( rChartSize ),
diff --git a/xmloff/source/chart/SchXMLRegressionCurveObjectContext.hxx b/xmloff/source/chart/SchXMLRegressionCurveObjectContext.hxx
index 138449327edf..4c3effb3cdf7 100644
--- a/xmloff/source/chart/SchXMLRegressionCurveObjectContext.hxx
+++ b/xmloff/source/chart/SchXMLRegressionCurveObjectContext.hxx
@@ -31,8 +31,6 @@ public:
     SchXMLRegressionCurveObjectContext(
         SchXMLImportHelper& rImportHelper,
         SvXMLImport& rImport,
-        sal_uInt16 nPrefix,
-        const OUString& rLocalName,
         std::vector< RegressionStyle >& rRegressionStyleVector,
         const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
         const css::awt::Size & rChartSize );
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index 576d628d2fe5..434018276e93 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -73,18 +73,14 @@ private:
 
 public:
     SchXMLDomain2Context( SvXMLImport& rImport,
-                          sal_uInt16 nPrefix,
-                          const OUString& rLocalName,
                           ::std::vector< OUString > & rAddresses );
     virtual void StartElement( const Reference< xml::sax::XAttributeList >& xAttrList ) override;
 };
 
 SchXMLDomain2Context::SchXMLDomain2Context(
     SvXMLImport& rImport,
-    sal_uInt16 nPrefix,
-    const OUString& rLocalName,
     ::std::vector< OUString > & rAddresses ) :
-        SvXMLImportContext( rImport, nPrefix, rLocalName ),
+        SvXMLImportContext( rImport ),
         mrAddresses( rAddresses )
 {
 }
@@ -677,66 +673,64 @@ void SchXMLSeries2Context::endFastElement(sal_Int32 )
     maPostponedSequences.clear();
 }
 
-SvXMLImportContextRef SchXMLSeries2Context::CreateChildContext(
-    sal_uInt16 nPrefix,
-    const OUString& rLocalName,
-    const uno::Reference< xml::sax::XAttributeList >&  )
+css::uno::Reference< css::xml::sax::XFastContextHandler > SchXMLSeries2Context::createFastChildContext(
+    sal_Int32 nElement,
+    const css::uno::Reference< css::xml::sax::XFastAttributeList >&  )
 {
     SvXMLImportContext* pContext = nullptr;
-    const SvXMLTokenMap& rTokenMap = mrImportHelper.GetSeriesElemTokenMap();
 
-    switch( rTokenMap.Get( nPrefix, rLocalName ))
+    switch(nElement)
     {
-        case XML_TOK_SERIES_DOMAIN:
+        case XML_ELEMENT(CHART, XML_DOMAIN):
             if( m_xSeries.is())
             {
                 m_bHasDomainContext = true;
                 pContext = new SchXMLDomain2Context(
-                    GetImport(),
-                    nPrefix, rLocalName,
-                    maDomainAddresses );
+                    GetImport(), maDomainAddresses );
             }
             break;
 
-        case XML_TOK_SERIES_MEAN_VALUE_LINE:
+        case XML_ELEMENT(CHART, XML_MEAN_VALUE):
             pContext = new SchXMLStatisticsObjectContext(
                 mrImportHelper, GetImport(),
-                nPrefix, rLocalName, msAutoStyleName,
+                msAutoStyleName,
                 mrStyleVector, m_xSeries,
                 SchXMLStatisticsObjectContext::CONTEXT_TYPE_MEAN_VALUE_LINE,
                 mrLSequencesPerIndex );
             break;
-        case XML_TOK_SERIES_REGRESSION_CURVE:
+        case XML_ELEMENT(CHART, XML_REGRESSION_CURVE):
             pContext = new SchXMLRegressionCurveObjectContext(
                 mrImportHelper, GetImport(),
-                nPrefix, rLocalName, mrRegressionStyleVector,
+                mrRegressionStyleVector,
                 m_xSeries, maChartSize );
             break;
-        case XML_TOK_SERIES_ERROR_INDICATOR:
+        case XML_ELEMENT(CHART, XML_ERROR_INDICATOR):
             pContext = new SchXMLStatisticsObjectContext(
                 mrImportHelper, GetImport(),
-                nPrefix, rLocalName, msAutoStyleName,
+                msAutoStyleName,
                 mrStyleVector, m_xSeries,
                 SchXMLStatisticsObjectContext::CONTEXT_TYPE_ERROR_INDICATOR,
                 mrLSequencesPerIndex );
             break;
 
-        case XML_TOK_SERIES_DATA_POINT:
+        case XML_ELEMENT(CHART, XML_DATA_POINT):
             pContext = new SchXMLDataPointContext( GetImport(),
                                                    mrStyleVector, m_xSeries, mnDataPointIndex, mbSymbolSizeIsMissingInFile );
             break;
-        case XML_TOK_SERIES_DATA_LABEL:
+        case XML_ELEMENT(CHART, XML_DATA_LABEL):
             // CustomLabels are useless for a data label element as child of a series, because it serves as default
             // for all data labels. But the ctor expects it, so use that of the mDataLabel struct as ersatz.
             pContext = new SchXMLDataLabelContext(GetImport(), mDataLabel.mCustomLabels,
                                                   mDataLabel);
             break;
 
-        case XML_TOK_SERIES_PROPERTY_MAPPING:
+        case XML_ELEMENT(LO_EXT, XML_PROPERTY_MAPPING):
             pContext = new SchXMLPropertyMappingContext( mrImportHelper,
-                    GetImport(), rLocalName,
+                    GetImport(),
                     mrLSequencesPerIndex, m_xSeries );
             break;
+        default:
+            XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     }
 
     return pContext;
diff --git a/xmloff/source/chart/SchXMLSeries2Context.hxx b/xmloff/source/chart/SchXMLSeries2Context.hxx
index b3ef3106cae5..1bced37cfdeb 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.hxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.hxx
@@ -86,10 +86,9 @@ public:
     virtual ~SchXMLSeries2Context() override;
 
     virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) 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 >& AttrList ) override;
     virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
 
     static void initSeriesPropertySets( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles


More information about the Libreoffice-commits mailing list