diff options
author | Jozsef Szakacs <zmx3@citromail.hu> | 2018-11-28 09:13:03 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2018-12-01 09:29:43 +0100 |
commit | 21399c7378be020e5e43fc07575f46e87e2d607b (patch) | |
tree | 3166d493b8bafacb34e437c0fa0e16288ca62e83 /oox | |
parent | bb8c2b1cbf7a9eb56b1515f60a2aadbef24199a2 (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
Change-Id: Ie763cf831c2ce63ef204d1fdcbff634e7ca8fad5
Reviewed-on: https://gerrit.libreoffice.org/64146
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
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 08b296f57cb6..ce3c6984ad40 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1662,7 +1662,7 @@ void ChartExport::exportLineChart( const Reference< chart2::XChartType >& xChart FSEND ); } - exportAxesId(bPrimaryAxes); + exportAxesId(bPrimaryAxes, true); pFS->endElement( FSNS( XML_c, nTypeId ) ); } @@ -3369,14 +3369,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 ), |