diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2018-08-22 11:15:45 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-08-23 13:45:58 +0200 |
commit | 17c2b0af97f73b9103be982b15d7111b3980e027 (patch) | |
tree | 80add5142314641bb2aa4ea2c9f3af825e758c67 /oox | |
parent | 47b8e414dd6f034a94f594c237c428c69a07f0cf (diff) |
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
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/chartexport.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 654ffdbfb008..97adab7f5b00 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 ); + } } } |