[PATCH libreoffice-4-0] we need to register data sequences during import, fdo#52159
Markus Mohrhard (via Code Review)
gerrit at gerrit.libreoffice.org
Mon Mar 18 11:18:43 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/2821
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/21/2821/1
we need to register data sequences during import, fdo#52159
Change-Id: I203be719a6ee19c87ed232218f7700d875c2871f
(cherry picked from commit 094bab7f9097fba62800d3dd578bd42640d8c6e2)
---
M xmloff/source/chart/SchXMLPlotAreaContext.cxx
M xmloff/source/chart/SchXMLPlotAreaContext.hxx
M xmloff/source/chart/SchXMLSeries2Context.cxx
3 files changed, 17 insertions(+), 9 deletions(-)
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 @@
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 @@
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 @@
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 @@
m_xSeries( xSeries ),
meContextType( eContextType ),
maChartSize( rChartSize ),
- maSeriesStyleName( rSeriesStyleName)
+ maSeriesStyleName( rSeriesStyleName),
+ mrLSequencesPerIndex(rLSequencesPerIndex)
{}
SchXMLStatisticsObjectContext::~SchXMLStatisticsObjectContext()
@@ -1216,10 +1222,10 @@
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 @@
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 @@
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 @@
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 @@
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 @@
nPrefix, rLocalName, msAutoStyleName,
mrStyleList, m_xSeries,
SchXMLStatisticsObjectContext::CONTEXT_TYPE_ERROR_INDICATOR,
- maChartSize );
+ maChartSize, mrLSequencesPerIndex );
break;
case XML_TOK_SERIES_DATA_POINT:
--
To view, visit https://gerrit.libreoffice.org/2821
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I203be719a6ee19c87ed232218f7700d875c2871f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Markus Mohrhard <markus.mohrhard at googlemail.com>
More information about the LibreOffice
mailing list