summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-03-18 01:57:03 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-03-18 02:30:17 +0100
commit094bab7f9097fba62800d3dd578bd42640d8c6e2 (patch)
treeab1d1f4c4224129bab1035e117102d5215acc0e3
parente15d8ef44fbf9fc23da58648e4d288782a81c7c1 (diff)
we need to register data sequences during import, fdo#52159
Change-Id: I203be719a6ee19c87ed232218f7700d875c2871f
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx16
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.hxx4
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.cxx6
3 files changed, 17 insertions, 9 deletions
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 9d3c47424f3d..a6ca2b526c5b 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -958,7 +958,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 );
@@ -999,6 +1000,9 @@ static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocume
Reference< chart2::data::XLabeledDataSequence > xLabelSeq( chart2::data::LabeledDataSequence::create(xContext),
uno::UNO_QUERY_THROW );
+ rSequences.insert( tSchXMLLSequencesPerIndex::value_type(
+ tSchXMLIndexWithPart( -2, SCH_XML_PART_ERROR_BARS ), xLabelSeq ) );
+
xLabelSeq->setValues( xNewSequence );
uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences(
@@ -1021,7 +1025,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 ),
@@ -1029,7 +1034,8 @@ SchXMLStatisticsObjectContext::SchXMLStatisticsObjectContext(
m_xSeries( xSeries ),
meContextType( eContextType ),
maChartSize( rChartSize ),
- maSeriesStyleName( rSeriesStyleName)
+ maSeriesStyleName( rSeriesStyleName),
+ mrLSequencesPerIndex(rLSequencesPerIndex)
{}
SchXMLStatisticsObjectContext::~SchXMLStatisticsObjectContext()
@@ -1217,10 +1223,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 07dd9e2284ac..222a365a9437 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: