[Libreoffice-commits] core.git: Branch 'libreoffice-4-0-2' - xmloff/source

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Mar 25 08:44:16 PDT 2013


 xmloff/source/chart/SchXMLPlotAreaContext.cxx |   16 +++++++++++-----
 xmloff/source/chart/SchXMLPlotAreaContext.hxx |    4 +++-
 xmloff/source/chart/SchXMLSeries2Context.cxx  |    6 +++---
 3 files changed, 17 insertions(+), 9 deletions(-)

New commits:
commit d53e6dea138397104b32bed53a082f892d9fa2e9
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Mar 18 01:57:03 2013 +0100

    we need to register data sequences during import, fdo#52159
    
    Change-Id: I203be719a6ee19c87ed232218f7700d875c2871f
    (cherry picked from commit 094bab7f9097fba62800d3dd578bd42640d8c6e2)
    Reviewed-on: https://gerrit.libreoffice.org/2821
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
    (cherry picked from commit bdfaf33419a9720d2afb48238a110a3cf8238aec)
    Reviewed-on: https://gerrit.libreoffice.org/2985
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Petr Mladek <pmladek at suse.cz>
    Tested-by: Petr Mladek <pmladek at suse.cz>

diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 0a3eca0..49da97c 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -957,7 +957,8 @@ void SchXMLStockContext::StartElement( const uno::Reference< xml::sax::XAttribut
 static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocument > &xDoc,
                                const uno::Reference< beans::XPropertySet > &xBarProp,
                                const rtl::OUString &aXMLRange,
-                               bool bPositiveValue, bool bYError )
+                               bool bPositiveValue, bool bYError,
+                               tSchXMLLSequencesPerIndex& rSequences)
 {
     uno::Reference< com::sun::star::chart2::data::XDataProvider > xDataProvider(xDoc->getDataProvider());
     uno::Reference< com::sun::star::chart2::data::XDataSource > xDataSource( xBarProp, uno::UNO_QUERY );
@@ -998,6 +999,9 @@ static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocume
         Reference< chart2::data::XLabeledDataSequence > xLabelSeq(
             xFact->createInstance("com.sun.star.chart2.data.LabeledDataSequence"), uno::UNO_QUERY );
 
+        rSequences.insert( tSchXMLLSequencesPerIndex::value_type(
+                    tSchXMLIndexWithPart( -2, SCH_XML_PART_ERROR_BARS ), xLabelSeq ) );
+
         xLabelSeq->setValues( xNewSequence );
 
         uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences(
@@ -1020,7 +1024,8 @@ SchXMLStatisticsObjectContext::SchXMLStatisticsObjectContext(
     const ::com::sun::star::uno::Reference<
                 ::com::sun::star::chart2::XDataSeries >& xSeries,
     ContextType eContextType,
-    const awt::Size & rChartSize ) :
+    const awt::Size & rChartSize,
+    tSchXMLLSequencesPerIndex & rLSequencesPerIndex) :
 
         SvXMLImportContext( rImport, nPrefix, rLocalName ),
         mrImportHelper( rImpHelper ),
@@ -1028,7 +1033,8 @@ SchXMLStatisticsObjectContext::SchXMLStatisticsObjectContext(
         m_xSeries( xSeries ),
         meContextType( eContextType ),
         maChartSize( rChartSize ),
-        maSeriesStyleName( rSeriesStyleName)
+        maSeriesStyleName( rSeriesStyleName),
+        mrLSequencesPerIndex(rLSequencesPerIndex)
 {}
 
 SchXMLStatisticsObjectContext::~SchXMLStatisticsObjectContext()
@@ -1216,10 +1222,10 @@ void SchXMLStatisticsObjectContext::StartElement( const uno::Reference< xml::sax
                     uno::Reference< chart2::XChartDocument > xDoc(GetImport().GetModel(),uno::UNO_QUERY);
 
                     if (!aPosRange.isEmpty())
-                        lcl_setErrorBarSequence(xDoc,xBarProp,aPosRange,true,bYError);
+                        lcl_setErrorBarSequence(xDoc,xBarProp,aPosRange,true,bYError, mrLSequencesPerIndex);
 
                     if (!aNegRange.isEmpty())
-                        lcl_setErrorBarSequence(xDoc,xBarProp,aNegRange,false,bYError);
+                        lcl_setErrorBarSequence(xDoc,xBarProp,aNegRange,false,bYError, mrLSequencesPerIndex);
 
                     if ( !bYError )
                     {
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
index 8ed329a..3f4d133 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
@@ -265,7 +265,8 @@ public:
         const ::com::sun::star::uno::Reference<
                 ::com::sun::star::chart2::XDataSeries >& xSeries,
         ContextType eContextType,
-        const ::com::sun::star::awt::Size & rChartSize );
+        const ::com::sun::star::awt::Size & rChartSize,
+        tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
 
     virtual ~SchXMLStatisticsObjectContext();
 
@@ -283,6 +284,7 @@ private:
     ContextType                                    meContextType;
     ::com::sun::star::awt::Size                    maChartSize;
     rtl::OUString maSeriesStyleName;
+    tSchXMLLSequencesPerIndex& mrLSequencesPerIndex;
 };
 
 // ----------------------------------------
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index e3188b9..8e6bbf0 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -648,7 +648,7 @@ SvXMLImportContext* SchXMLSeries2Context::CreateChildContext(
                 nPrefix, rLocalName, msAutoStyleName,
                 mrStyleList, m_xSeries,
                 SchXMLStatisticsObjectContext::CONTEXT_TYPE_MEAN_VALUE_LINE,
-                maChartSize );
+                maChartSize, mrLSequencesPerIndex );
             break;
         case XML_TOK_SERIES_REGRESSION_CURVE:
             pContext = new SchXMLStatisticsObjectContext(
@@ -656,7 +656,7 @@ SvXMLImportContext* SchXMLSeries2Context::CreateChildContext(
                 nPrefix, rLocalName, msAutoStyleName,
                 mrStyleList, m_xSeries,
                 SchXMLStatisticsObjectContext::CONTEXT_TYPE_REGRESSION_CURVE,
-                maChartSize );
+                maChartSize, mrLSequencesPerIndex );
             break;
         case XML_TOK_SERIES_ERROR_INDICATOR:
             pContext = new SchXMLStatisticsObjectContext(
@@ -664,7 +664,7 @@ SvXMLImportContext* SchXMLSeries2Context::CreateChildContext(
                 nPrefix, rLocalName, msAutoStyleName,
                 mrStyleList, m_xSeries,
                 SchXMLStatisticsObjectContext::CONTEXT_TYPE_ERROR_INDICATOR,
-                maChartSize );
+                maChartSize, mrLSequencesPerIndex );
             break;
 
         case XML_TOK_SERIES_DATA_POINT:


More information about the Libreoffice-commits mailing list