summaryrefslogtreecommitdiffstats
path: root/oox
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2018-08-22 11:15:45 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-08-23 16:40:00 +0200
commit8a7062c02c54330c3b6be0471dbc8a74e60aa479 (patch)
tree43a5a9bac34ac480c95fbb684c72346478c577e3 /oox
parenttdf#119357 add the glyph, if the lookup failed (diff)
downloadcore-8a7062c02c54330c3b6be0471dbc8a74e60aa479.tar.gz
core-8a7062c02c54330c3b6be0471dbc8a74e60aa479.zip
tdf#94502 Fix overlap export of Stacked Bar Chart to *.xlsx
Export the Overlap value with 100% for stacked charts, because the default overlap value of the Bar/Column chart is 0% and LibreOffice do nothing with the overlap value in Stacked Chart case, unlike the MS Office. Change-Id: If4e20b88c2b1180f68a8d2b610c407d674a8498b Reviewed-on: https://gerrit.libreoffice.org/59448 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Jenkins (cherry picked from commit 17c2b0af97f73b9103be982b15d7111b3980e027) Reviewed-on: https://gerrit.libreoffice.org/59497 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 3a97ee186560..43fe63a51554 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1498,9 +1498,24 @@ void ChartExport::exportBarChart( const Reference< chart2::XChartType >& xChartT
if( aBarPositionSequence.getLength() )
{
sal_Int32 nOverlap = aBarPositionSequence[0];
- pFS->singleElement( FSNS( XML_c, XML_overlap ),
+ // Stacked/Percent Bar/Column chart Overlap-workaround
+ // Export the Overlap value with 100% for stacked charts,
+ // because the default overlap value of the Bar/Column chart is 0% and
+ // LibreOffice do nothing with the overlap value in Stacked charts case,
+ // unlike the MS Office, which is interpreted differently.
+ if( ( mbStacked || mbPercent ) && nOverlap != 100 )
+ {
+ nOverlap = 100;
+ pFS->singleElement( FSNS( XML_c, XML_overlap ),
+ XML_val, I32S( nOverlap ),
+ FSEND );
+ }
+ else // Normal bar chart
+ {
+ pFS->singleElement( FSNS( XML_c, XML_overlap ),
XML_val, I32S( nOverlap ),
FSEND );
+ }
}
}