summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2018-08-09 00:06:47 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2018-08-10 07:05:30 +0200
commitc958f52b813d34baa9b5236bb34a08a04e6b0aba (patch)
tree39c11e35a86e4edf250bdc768f91daf9d2a3c254 /oox/source
parenta94a481c9f5088e6957220a7e09b64fc3f15aaf1 (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. Change-Id: I3d975675ac3691fcafe76de16e46851561eb2807 Reviewed-on: https://gerrit.libreoffice.org/58752 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'oox/source')
-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 2ef2074aa068..654ffdbfb008 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3284,6 +3284,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 & )
+ {
+ DBG_UNHANDLED_EXCEPTION( "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)