diff options
author | Jozsef Szakacs <zmx3@citromail.hu> | 2018-11-28 09:13:03 +0100 |
---|---|---|
committer | Aron Budea <aron.budea@collabora.com> | 2019-03-11 12:11:06 +0100 |
commit | 25e391fb6273c444bac8314213d49089403a7f04 (patch) | |
tree | b3397301b2cbce93d117cdb865a949d58d1d16d7 /oox | |
parent | 0982652eb252eb37beba7760b4a00b1f53ffa7c2 (diff) |
tdf#121744 XLSX Export Combinated Chart (Column and Line)
Each of the Column and Line Chart creates it's own x and y Axes.
So now the LineChart Exporter Method uses the same Axes as the BarChart.
Thanks for the help:
- Balazs Varga
- Adam Kovacs
Reviewed-on: https://gerrit.libreoffice.org/64146
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Reviewed-on: https://gerrit.libreoffice.org/65449
(cherry picked from commit d58d92d72b00f45c56a3b0fe55ca9fd837d244a9)
Change-Id: Ie763cf831c2ce63ef204d1fdcbff634e7ca8fad5
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/chartexport.cxx | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 37c267dcbcd3..aa7d8a543d7e 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1619,7 +1619,7 @@ void ChartExport::exportLineChart( const Reference< chart2::XChartType >& xChart FSEND ); } - exportAxesId(bPrimaryAxes); + exportAxesId(bPrimaryAxes, true); pFS->endElement( FSNS( XML_c, nTypeId ) ); } @@ -3333,14 +3333,24 @@ void ChartExport::exportDataPoints( } } -void ChartExport::exportAxesId(bool bPrimaryAxes) +void ChartExport::exportAxesId(bool bPrimaryAxes, bool bCheckCombinedAxes) { - sal_Int32 nAxisIdx = lcl_generateRandomValue(); - sal_Int32 nAxisIdy = lcl_generateRandomValue(); - AxesType eXAxis = bPrimaryAxes ? AXIS_PRIMARY_X : AXIS_SECONDARY_X; - AxesType eYAxis = bPrimaryAxes ? AXIS_PRIMARY_Y : AXIS_SECONDARY_Y; - maAxes.emplace_back( eXAxis, nAxisIdx, nAxisIdy ); - maAxes.emplace_back( eYAxis, nAxisIdy, nAxisIdx ); + sal_Int32 nAxisIdx, nAxisIdy; + // tdf#114181 keep axes of combined charts + if ( bCheckCombinedAxes && bPrimaryAxes && maAxes.size() == 2 ) + { + nAxisIdx = maAxes[0].nAxisId; + nAxisIdy = maAxes[1].nAxisId; + } + else + { + nAxisIdx = lcl_generateRandomValue(); + nAxisIdy = lcl_generateRandomValue(); + AxesType eXAxis = bPrimaryAxes ? AXIS_PRIMARY_X : AXIS_SECONDARY_X; + AxesType eYAxis = bPrimaryAxes ? AXIS_PRIMARY_Y : AXIS_SECONDARY_Y; + maAxes.emplace_back( eXAxis, nAxisIdx, nAxisIdy ); + maAxes.emplace_back( eYAxis, nAxisIdy, nAxisIdx ); + } FSHelperPtr pFS = GetFS(); pFS->singleElement( FSNS( XML_c, XML_axId ), XML_val, I32S( nAxisIdx ), |