From d53e6dea138397104b32bed53a082f892d9fa2e9 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Mon, 18 Mar 2013 01:57:03 +0100 Subject: 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 Tested-by: Fridrich Strba (cherry picked from commit bdfaf33419a9720d2afb48238a110a3cf8238aec) Reviewed-on: https://gerrit.libreoffice.org/2985 Reviewed-by: Eike Rathke Reviewed-by: Petr Mladek Tested-by: Petr Mladek --- 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(-) diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 0a3eca028046..49da97c6b977 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 8ed329a33f4d..3f4d1337b7e1 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 e3188b945a6a..8e6bbf021490 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: -- cgit v1.2.3