summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2018-08-09 00:06:47 +0200
committerAndras Timar <andras.timar@collabora.com>2018-08-29 10:51:52 +0200
commitfa465c8506e99d9bc396b33dd8d3d30d6d791de1 (patch)
tree07fdb792475dc14cfd3a52591a660dc820447bf6 /oox
parent63269e263142e4d04ba14484c42b801e0d2a7c44 (diff)
tdf#96469 Export Data Point properties in Charts on DOCX/XLSX
If the color or other property of a datapoint in the chart deviates from the dataseries property, this patch will write it into a separate dPt tag and fixing the lost properies during OOXML export. Reviewed-on: https://gerrit.libreoffice.org/58806 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Jenkins (cherry picked from commit 15035b98dc694bde4c4073fa75bdd2ce9d7e6670) Change-Id: I3d975675ac3691fcafe76de16e46851561eb2807 Reviewed-on: https://gerrit.libreoffice.org/58807 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga991@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit 6fa9aaaa5dca4d6b79698b55a2f2c956c99c3482)
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx51
1 files changed, 51 insertions, 0 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 9ecae1cc74f4..e7dbcf90d4c2 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3249,6 +3249,57 @@ void ChartExport::exportDataPoints(
}
}
}
+
+ // Export Data Point Property in Charts even if the VaryColors is false
+ if( !bVaryColorsByPoint )
+ {
+ ::std::set< sal_Int32 > aAttrPointSet;
+ ::std::copy( pPoints, pPoints + aDataPointSeq.getLength(),
+ ::std::inserter( aAttrPointSet, aAttrPointSet.begin()));
+ const ::std::set< sal_Int32 >::const_iterator aEndIt( aAttrPointSet.end());
+ for( nElement = 0; nElement < nSeriesLength; ++nElement )
+ {
+ uno::Reference< beans::XPropertySet > xPropSet;
+ if( aAttrPointSet.find( nElement ) != aEndIt )
+ {
+ try
+ {
+ xPropSet = SchXMLSeriesHelper::createOldAPIDataPointPropertySet(
+ xSeries, nElement, getModel() );
+ }
+ catch( const uno::Exception & )
+ {
+ SAL_WARN( "oox", "Exception caught during Export of data point" );
+ }
+ }
+
+ if( xPropSet.is() )
+ {
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_dPt ),
+ FSEND );
+ pFS->singleElement( FSNS( XML_c, XML_idx ),
+ XML_val, I32S(nElement),
+ FSEND );
+
+ switch( eChartType )
+ {
+ case chart::TYPEID_BUBBLE:
+ case chart::TYPEID_HORBAR:
+ case chart::TYPEID_BAR:
+ {
+ pFS->singleElement(FSNS(XML_c, XML_invertIfNegative),
+ XML_val, "0",
+ FSEND);
+ }
+ break;
+ }
+ exportShapeProps( xPropSet );
+
+ pFS->endElement( FSNS( XML_c, XML_dPt ) );
+ }
+ }
+ }
}
void ChartExport::exportAxesId(bool bPrimaryAxes)