summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2021-08-25 20:51:56 +0530
committerMiklos Vajna <vmiklos@collabora.com>2021-09-01 09:15:03 +0200
commit9d8324524bdcd1244cd6e9d93b063b981d47c9be (patch)
tree1bbd6560ef3a292b0685d4b768ea1a07c17259b8 /oox
parentb365358075d484e034eb9cd6bceeea9d639835b6 (diff)
tdf#143942: oox: import/export labels from <c15:datalabelsRange>
When <c15:showDataLabelsRange> boolean flag is present, the imported label texts are added as the first text field in oox data label model. The cell-range associated is also preserved. The export part preserves the how labels were store originally in <c15:datalabelsRange>. However in order to make the custom labels reflect the contents of the cells in the associated cell-range, more work needs to be done. For this the labels present in <c15:datalabelsRange> needs to be made available as a data-sequence with a new "role" like "point-labels" in XInternalDataProvider implementation and and make the label renderer read this data source rather than consulting the custom label fields property which is static after import. Change-Id: Ibc7045fa5ea209d463680c96efb49a06662d2500 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121313 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/drawingml/chart/datasourcecontext.hxx1
-rw-r--r--oox/inc/drawingml/chart/seriesmodel.hxx15
-rw-r--r--oox/source/drawingml/chart/datasourcecontext.cxx21
-rw-r--r--oox/source/drawingml/chart/seriescontext.cxx55
-rw-r--r--oox/source/drawingml/chart/seriesconverter.cxx30
-rw-r--r--oox/source/drawingml/chart/seriesmodel.cxx4
-rw-r--r--oox/source/export/chartexport.cxx133
-rw-r--r--oox/source/token/tokens.txt3
8 files changed, 239 insertions, 23 deletions
diff --git a/oox/inc/drawingml/chart/datasourcecontext.hxx b/oox/inc/drawingml/chart/datasourcecontext.hxx
index 8ce8469cc3cb..ec64c4768180 100644
--- a/oox/inc/drawingml/chart/datasourcecontext.hxx
+++ b/oox/inc/drawingml/chart/datasourcecontext.hxx
@@ -69,6 +69,7 @@ public:
private:
sal_Int32 mnPtIndex; /// Current data point index.
+ bool mbReadC15; /// Allow reading extension tags data under c15 namespace.
};
diff --git a/oox/inc/drawingml/chart/seriesmodel.hxx b/oox/inc/drawingml/chart/seriesmodel.hxx
index c4fb557d282d..460293a5feee 100644
--- a/oox/inc/drawingml/chart/seriesmodel.hxx
+++ b/oox/inc/drawingml/chart/seriesmodel.hxx
@@ -41,12 +41,18 @@ struct DataLabelModelBase
OptValue< bool > mobShowPercent; /// True = show percentual value in pie/doughnut charts.
OptValue< bool > mobShowSerName; /// True = show series name.
OptValue< bool > mobShowVal; /// True = show data point value.
+
+ /// True = the value from the <c15:datalabelsRange> corresponding to the
+ /// index of this label is used as the label text.
+ OptValue< bool > mobShowDataLabelsRange;
bool mbDeleted; /// True = data label(s) deleted.
explicit DataLabelModelBase(bool bMSO2007Doc);
~DataLabelModelBase();
};
+struct DataLabelsModel;
+
struct DataLabelModel : public DataLabelModelBase
{
typedef ModelRef< LayoutModel > LayoutRef;
@@ -54,9 +60,10 @@ struct DataLabelModel : public DataLabelModelBase
LayoutRef mxLayout; /// Layout/position of the data point label frame.
TextRef mxText; /// Manual or linked text for this data point label.
+ const DataLabelsModel& mrParent; /// Reference to the labels container.
sal_Int32 mnIndex; /// Data point index for this data label.
- explicit DataLabelModel(bool bMSO2007Doc);
+ explicit DataLabelModel(const DataLabelsModel& rParent, bool bMSO2007Doc);
~DataLabelModel();
};
@@ -67,6 +74,9 @@ struct DataLabelsModel : public DataLabelModelBase
DataLabelVector maPointLabels; /// Settings for individual data point labels.
ShapeRef mxLeaderLines; /// Formatting of connector lines between data points and labels.
+
+ /// Labels source (owned by SeriesModel's DataSourceMap)
+ const DataSourceModel* mpLabelsSource;
bool mbShowLeaderLines; /// True = show connector lines between data points and labels.
explicit DataLabelsModel(bool bMSO2007Doc);
@@ -171,7 +181,8 @@ struct SeriesModel
{
CATEGORIES, /// Data point categories.
VALUES, /// Data point values.
- POINTS /// Data point size (e.g. bubble size in bubble charts).
+ POINTS, /// Data point size (e.g. bubble size in bubble charts).
+ DATALABELS, /// Data point labels.
};
typedef ModelMap< SourceType, DataSourceModel > DataSourceMap;
diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx b/oox/source/drawingml/chart/datasourcecontext.cxx
index eac776e107d9..1b64089d4281 100644
--- a/oox/source/drawingml/chart/datasourcecontext.cxx
+++ b/oox/source/drawingml/chart/datasourcecontext.cxx
@@ -166,6 +166,7 @@ SvNumberFormatter* DoubleSequenceContext::getNumberFormatter()
StringSequenceContext::StringSequenceContext( ContextHandler2Helper& rParent, DataSequenceModel& rModel )
: DataSequenceContextBase( rParent, rModel )
, mnPtIndex(-1)
+ , mbReadC15(false)
{
}
@@ -186,6 +187,16 @@ ContextHandlerRef StringSequenceContext::onCreateContext( sal_Int32 nElement, co
}
break;
+ case C15_TOKEN( datalabelsRange ):
+ mbReadC15 = true;
+ switch( nElement )
+ {
+ case C15_TOKEN( f ):
+ case C15_TOKEN( dlblRangeCache ):
+ return this;
+ }
+ break;
+
case C_TOKEN( strRef ):
switch( nElement )
{
@@ -197,6 +208,10 @@ ContextHandlerRef StringSequenceContext::onCreateContext( sal_Int32 nElement, co
case C_TOKEN( strCache ):
case C_TOKEN( strLit ):
+ case C15_TOKEN( dlblRangeCache ):
+ if (nElement == C15_TOKEN( dlblRangeCache ) && !mbReadC15)
+ break;
+
switch( nElement )
{
case C_TOKEN( ptCount ):
@@ -248,6 +263,10 @@ void StringSequenceContext::onCharacters( const OUString& rChars )
case C_TOKEN( f ):
mrModel.maFormula = rChars;
break;
+ case C15_TOKEN( f ):
+ if (mbReadC15)
+ mrModel.maFormula = rChars;
+ break;
case C_TOKEN( v ):
if( mnPtIndex >= 0 )
mrModel.maData[ (mrModel.mnLevelCount-1) * mrModel.mnPointCount + mnPtIndex ] <<= rChars;
@@ -270,11 +289,13 @@ ContextHandlerRef DataSourceContext::onCreateContext( sal_Int32 nElement, const
{
case C_TOKEN( cat ):
case C_TOKEN( xVal ):
+ case C_TOKEN( ext ):
switch( nElement )
{
case C_TOKEN( multiLvlStrRef ):
case C_TOKEN( strLit ):
case C_TOKEN( strRef ):
+ case C15_TOKEN( datalabelsRange ):
OSL_ENSURE( !mrModel.mxDataSeq, "DataSourceContext::onCreateContext - multiple data sequences" );
return new StringSequenceContext( *this, mrModel.mxDataSeq.create() );
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index 3f92818c5544..5afc32c1497d 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -100,15 +100,37 @@ DataLabelContext::~DataLabelContext()
ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( isRootElement() ) switch( nElement )
+ if( isRootElement() )
{
- case C_TOKEN( idx ):
- mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
- return nullptr;
- case C_TOKEN( layout ):
- return new LayoutContext( *this, mrModel.mxLayout.create() );
- case C_TOKEN( tx ):
- return new TextContext( *this, mrModel.mxText.create() );
+ switch( nElement )
+ {
+ case C_TOKEN( idx ):
+ mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
+ return nullptr;
+ case C_TOKEN( layout ):
+ return new LayoutContext( *this, mrModel.mxLayout.create() );
+ case C_TOKEN( tx ):
+ return new TextContext( *this, mrModel.mxText.create() );
+ case C_TOKEN( extLst ):
+ return this;
+ }
+ }
+ else
+ {
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( extLst ):
+ if ( nElement == C_TOKEN( ext ) )
+ return this;
+ break;
+ case C_TOKEN( ext ):
+ if ( nElement == C15_TOKEN( showDataLabelsRange ) )
+ {
+ mrModel.mobShowDataLabelsRange = rAttribs.getBool( XML_val );
+ return nullptr;
+ }
+ break;
+ }
}
bool bMSO2007 = getFilter().isMSO2007Document();
return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel, bMSO2007 );
@@ -135,7 +157,7 @@ ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( dLbl ):
- return new DataLabelContext( *this, mrModel.maPointLabels.create(bMSO2007Doc) );
+ return new DataLabelContext( *this, mrModel.maPointLabels.create(mrModel, bMSO2007Doc) );
case C_TOKEN( leaderLines ):
return new ShapePrWrapperContext( *this, mrModel.mxLeaderLines.create() );
case C_TOKEN( showLeaderLines ):
@@ -390,6 +412,8 @@ ContextHandlerRef SeriesContextBase::onCreateContext( sal_Int32 nElement, const
return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
case C_TOKEN( tx ):
return new TextContext( *this, mrModel.mxText.create() );
+ case C_TOKEN( extLst ):
+ return this;
}
break;
@@ -406,6 +430,19 @@ ContextHandlerRef SeriesContextBase::onCreateContext( sal_Int32 nElement, const
return nullptr;
}
break;
+
+ case C_TOKEN( extLst ):
+ switch( nElement )
+ {
+ case C_TOKEN( ext ):
+ if (mrModel.maSources.has( SeriesModel::DATALABELS ))
+ break;
+
+ DataSourceModel& rLabelsSource = mrModel.maSources.create( SeriesModel::DATALABELS );
+ if (mrModel.mxLabels.is())
+ mrModel.mxLabels->mpLabelsSource = &rLabelsSource;
+ return new DataSourceContext( *this, rLabelsSource );
+ }
}
return nullptr;
}
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index 2c3341a30e1a..3f03e1e5c2a6 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -319,9 +319,25 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat
if( nParagraphs > 1 )
nSequenceSize += nParagraphs - 1;
+ OptValue< OUString > oaLabelText;
+ OptValue< OUString > oaCellRange;
+ if (mrModel.mobShowDataLabelsRange.get(false))
+ {
+ const DataSourceModel* pLabelSource = mrModel.mrParent.mpLabelsSource;
+ if (pLabelSource && pLabelSource->mxDataSeq.is())
+ {
+ oaCellRange = pLabelSource->mxDataSeq->maFormula;
+ const auto& rLabelMap = pLabelSource->mxDataSeq->maData;
+ const auto& rKV = rLabelMap.find(mrModel.mnIndex);
+ if (rKV != rLabelMap.end())
+ rKV->second >>= oaLabelText.use();
+ }
+ }
+
aSequence.realloc( nSequenceSize );
int nPos = 0;
+
for( auto& pParagraph : rParagraphs )
{
for( auto& pRun : pParagraph->getRuns() )
@@ -336,8 +352,18 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat
TextField* pField = nullptr;
if( ( pField = dynamic_cast< TextField* >( pRun.get() ) ) )
{
- xCustomLabel->setString( pField->getText() );
- xCustomLabel->setFieldType( lcl_ConvertFieldNameToFieldEnum( pField->getType() ) );
+ DataPointCustomLabelFieldType eType = lcl_ConvertFieldNameToFieldEnum( pField->getType() );
+
+ if (eType == DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLRANGE && oaCellRange.has())
+ {
+ xCustomLabel->setCellRange( oaCellRange.get() );
+ xCustomLabel->setString( oaLabelText.get() );
+ xCustomLabel->setDataLabelsRange( true );
+ }
+ else
+ xCustomLabel->setString( pField->getText() );
+
+ xCustomLabel->setFieldType( eType );
xCustomLabel->setGuid( pField->getUuid() );
}
else if( pRun )
diff --git a/oox/source/drawingml/chart/seriesmodel.cxx b/oox/source/drawingml/chart/seriesmodel.cxx
index 563e0e48e3bf..4ad9b2593af4 100644
--- a/oox/source/drawingml/chart/seriesmodel.cxx
+++ b/oox/source/drawingml/chart/seriesmodel.cxx
@@ -31,8 +31,9 @@ DataLabelModelBase::~DataLabelModelBase()
{
}
-DataLabelModel::DataLabelModel(bool bMSO2007Doc) :
+DataLabelModel::DataLabelModel(const DataLabelsModel& rParent, bool bMSO2007Doc) :
DataLabelModelBase(bMSO2007Doc),
+ mrParent( rParent ),
mnIndex( -1 )
{
}
@@ -43,6 +44,7 @@ DataLabelModel::~DataLabelModel()
DataLabelsModel::DataLabelsModel(bool bMSO2007Doc) :
DataLabelModelBase(bMSO2007Doc),
+ mpLabelsSource( nullptr ),
mbShowLeaderLines( !bMSO2007Doc )
{
}
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index dc122a4e97da..2e13b40288bb 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -485,6 +485,46 @@ static sal_Int32 lcl_getAlphaFromTransparenceGradient(const awt::Gradient& rGrad
return (255 - nRed) * oox::drawingml::MAX_PERCENT / 255;
}
+bool DataLabelsRange::empty() const
+{
+ return maLabels.empty();
+}
+
+size_t DataLabelsRange::count() const
+{
+ return maLabels.size();
+}
+
+bool DataLabelsRange::hasLabel(sal_Int32 nIndex) const
+{
+ return maLabels.find(nIndex) != maLabels.end();
+}
+
+OUString DataLabelsRange::getRange() const
+{
+ return maRange;
+}
+
+void DataLabelsRange::setRange(const OUString& rRange)
+{
+ maRange = rRange;
+}
+
+void DataLabelsRange::setLabel(sal_Int32 nIndex, const OUString& rText)
+{
+ maLabels.emplace(nIndex, rText);
+}
+
+DataLabelsRange::LabelsRangeMap::const_iterator DataLabelsRange::begin() const
+{
+ return maLabels.begin();
+}
+
+DataLabelsRange::LabelsRangeMap::const_iterator DataLabelsRange::end() const
+{
+ return maLabels.end();
+}
+
ChartExport::ChartExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, Reference< frame::XModel > const & xModel, XmlFilterBase* pFB, DocumentType eDocumentType )
: DrawingML( std::move(pFS), pFB, eDocumentType )
, mnXmlNamespace( nXmlNamespace )
@@ -2183,6 +2223,43 @@ void ChartExport::exportDoughnutChart( const Reference< chart2::XChartType >& xC
pFS->endElement( FSNS( XML_c, XML_doughnutChart ) );
}
+namespace {
+
+void writeDataLabelsRange(FSHelperPtr& pFS, XmlFilterBase* pFB, DataLabelsRange& rDLblsRange)
+{
+ if (rDLblsRange.empty())
+ return;
+
+ pFS->startElement(FSNS(XML_c, XML_extLst));
+ pFS->startElement(FSNS(XML_c, XML_ext), XML_uri, "{02D57815-91ED-43cb-92C2-25804820EDAC}", FSNS(XML_xmlns, XML_c15), pFB->getNamespaceURL(OOX_NS(c15)));
+ pFS->startElement(FSNS(XML_c15, XML_datalabelsRange));
+
+ // Write cell range.
+ pFS->startElement(FSNS(XML_c15, XML_f));
+ pFS->writeEscaped(rDLblsRange.getRange());
+ pFS->endElement(FSNS(XML_c15, XML_f));
+
+ // Write all labels.
+ pFS->startElement(FSNS(XML_c15, XML_dlblRangeCache));
+ pFS->singleElement(FSNS(XML_c, XML_ptCount), XML_val, OString::number(rDLblsRange.count()));
+ for (const auto& rLabelKV: rDLblsRange)
+ {
+ pFS->startElement(FSNS(XML_c, XML_pt), XML_idx, OString::number(rLabelKV.first));
+ pFS->startElement(FSNS(XML_c, XML_v));
+ pFS->writeEscaped(rLabelKV.second);
+ pFS->endElement(FSNS( XML_c, XML_v ));
+ pFS->endElement(FSNS(XML_c, XML_pt));
+ }
+
+ pFS->endElement(FSNS(XML_c15, XML_dlblRangeCache));
+
+ pFS->endElement(FSNS(XML_c15, XML_datalabelsRange));
+ pFS->endElement(FSNS(XML_c, XML_ext));
+ pFS->endElement(FSNS(XML_c, XML_extLst));
+}
+
+}
+
void ChartExport::exportLineChart( const Reference< chart2::XChartType >& xChartType )
{
FSHelperPtr pFS = GetFS();
@@ -2570,8 +2647,9 @@ void ChartExport::exportSeries( const Reference<chart2::XChartType>& xChartType,
// export data points
exportDataPoints( uno::Reference< beans::XPropertySet >( rSeries, uno::UNO_QUERY ), nSeriesLength, eChartType );
+ DataLabelsRange aDLblsRange;
// export data labels
- exportDataLabels(rSeries, nSeriesLength, eChartType);
+ exportDataLabels(rSeries, nSeriesLength, eChartType, aDLblsRange);
exportTrendlines( rSeries );
@@ -2644,6 +2722,9 @@ void ChartExport::exportSeries( const Reference<chart2::XChartType>& xChartType,
if( eChartType == chart::TYPEID_BUBBLE )
pFS->singleElement(FSNS(XML_c, XML_bubble3D), XML_val, "0");
+ if (!aDLblsRange.empty())
+ writeDataLabelsRange(pFS, GetFB(), aDLblsRange);
+
pFS->endElement( FSNS( XML_c, XML_ser ) );
}
}
@@ -3560,7 +3641,8 @@ void writeRunProperties( ChartExport* pChartExport, Reference<XPropertySet> cons
}
void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport,
- const Sequence<Reference<chart2::XDataPointCustomLabelField>>& rCustomLabelFields )
+ const Sequence<Reference<chart2::XDataPointCustomLabelField>>& rCustomLabelFields,
+ sal_Int32 nLabelIndex, DataLabelsRange& rDLblsRange )
{
pFS->startElement(FSNS(XML_c, XML_tx));
pFS->startElement(FSNS(XML_c, XML_rich));
@@ -3569,6 +3651,7 @@ void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport,
pFS->singleElement(FSNS(XML_a, XML_bodyPr));
OUString sFieldType;
+ OUString sContent;
pFS->startElement(FSNS(XML_a, XML_p));
for (auto& rField : rCustomLabelFields)
@@ -3576,8 +3659,25 @@ void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport,
Reference<XPropertySet> xPropertySet(rField, UNO_QUERY);
chart2::DataPointCustomLabelFieldType aType = rField->getFieldType();
sFieldType.clear();
+ sContent.clear();
bool bNewParagraph = false;
+ if (aType == chart2::DataPointCustomLabelFieldType_CELLRANGE &&
+ rField->getDataLabelsRange())
+ {
+ if (rDLblsRange.getRange().isEmpty())
+ rDLblsRange.setRange(rField->getCellRange());
+
+ if (!rDLblsRange.hasLabel(nLabelIndex))
+ rDLblsRange.setLabel(nLabelIndex, rField->getString());
+
+ sContent = "[CELLRANGE]";
+ }
+ else
+ {
+ sContent = rField->getString();
+ }
+
if (aType == chart2::DataPointCustomLabelFieldType_NEWLINE)
bNewParagraph = true;
else if (aType != chart2::DataPointCustomLabelFieldType_TEXT)
@@ -3597,7 +3697,7 @@ void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport,
writeRunProperties(pChartExport, xPropertySet);
pFS->startElement(FSNS(XML_a, XML_t));
- pFS->writeEscaped(rField->getString());
+ pFS->writeEscaped(sContent);
pFS->endElement(FSNS(XML_a, XML_t));
pFS->endElement(FSNS(XML_a, XML_r));
@@ -3610,7 +3710,7 @@ void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport,
writeRunProperties(pChartExport, xPropertySet);
pFS->startElement(FSNS(XML_a, XML_t));
- pFS->writeEscaped(rField->getString());
+ pFS->writeEscaped(sContent);
pFS->endElement(FSNS(XML_a, XML_t));
pFS->endElement(FSNS(XML_a, XML_fld));
@@ -3623,7 +3723,8 @@ void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport,
}
void writeLabelProperties( const FSHelperPtr& pFS, ChartExport* pChartExport,
- const uno::Reference<beans::XPropertySet>& xPropSet, const LabelPlacementParam& rLabelParam )
+ const uno::Reference<beans::XPropertySet>& xPropSet, const LabelPlacementParam& rLabelParam,
+ sal_Int32 nLabelIndex, DataLabelsRange& rDLblsRange )
{
if (!xPropSet.is())
return;
@@ -3678,7 +3779,7 @@ void writeLabelProperties( const FSHelperPtr& pFS, ChartExport* pChartExport,
pChartExport->exportTextProps(xPropSet);
if (aCustomLabelFields.hasElements())
- writeCustomLabel(pFS, pChartExport, aCustomLabelFields);
+ writeCustomLabel(pFS, pChartExport, aCustomLabelFields, nLabelIndex, rDLblsRange);
if (rLabelParam.mbExport)
{
@@ -3707,12 +3808,26 @@ void writeLabelProperties( const FSHelperPtr& pFS, ChartExport* pChartExport,
pFS->writeEscaped( nLabelSeparator );
pFS->endElement( FSNS( XML_c, XML_separator ) );
}
+
+ if (rDLblsRange.hasLabel(nLabelIndex))
+ {
+ pFS->startElement(FSNS(XML_c, XML_extLst));
+ pFS->startElement(FSNS(XML_c, XML_ext), XML_uri,
+ "{CE6537A1-D6FC-4f65-9D91-7224C49458BB}", FSNS(XML_xmlns, XML_c15),
+ pChartExport->GetFB()->getNamespaceURL(OOX_NS(c15)));
+
+ pFS->singleElement(FSNS(XML_c15, XML_showDataLabelsRange), XML_val, "1");
+
+ pFS->endElement(FSNS(XML_c, XML_ext));
+ pFS->endElement(FSNS(XML_c, XML_extLst));
+ }
}
}
void ChartExport::exportDataLabels(
- const uno::Reference<chart2::XDataSeries> & xSeries, sal_Int32 nSeriesLength, sal_Int32 eChartType )
+ const uno::Reference<chart2::XDataSeries> & xSeries, sal_Int32 nSeriesLength, sal_Int32 eChartType,
+ DataLabelsRange& rDLblsRange)
{
if (!xSeries.is() || nSeriesLength <= 0)
return;
@@ -3843,12 +3958,12 @@ void ChartExport::exportDataLabels(
}
// Individual label property that overwrites the baseline.
- writeLabelProperties(pFS, this, xLabelPropSet, aParam);
+ writeLabelProperties(pFS, this, xLabelPropSet, aParam, nIdx, rDLblsRange);
pFS->endElement(FSNS(XML_c, XML_dLbl));
}
// Baseline label properties for all labels.
- writeLabelProperties(pFS, this, xPropSet, aParam);
+ writeLabelProperties(pFS, this, xPropSet, aParam, -1, rDLblsRange);
bool bShowLeaderLines = false;
xPropSet->getPropertyValue("ShowCustomLeaderLines") >>= bShowLeaderLines;
diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt
index 997b3e8b3b25..9a10000c1fc8 100644
--- a/oox/source/token/tokens.txt
+++ b/oox/source/token/tokens.txt
@@ -1657,6 +1657,7 @@ dataValidation
dataValidations
database
databaseField
+datalabelsRange
datastoreItem
date
date1904
@@ -1872,6 +1873,7 @@ dkTurquoise
dkUpDiag
dkVert
dkViolet
+dlblRangeCache
dllVersion
dm
dn
@@ -4646,6 +4648,7 @@ showComments
showDLblsOverMax
showDataAs
showDataDropDown
+showDataLabelsRange
showDataTips
showDrill
showDropDown