summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorJozsef Szakacs <zmx3@citromail.hu>2018-11-28 09:13:03 +0100
committerLászló Németh <nemeth@numbertext.org>2018-12-20 11:23:38 +0100
commitd58d92d72b00f45c56a3b0fe55ca9fd837d244a9 (patch)
tree293fcac531d4b681d9964a36ba29c25e0b26896c /oox
parentab24108a996879e76a08a17afdce59814a5531eb (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> Reviewed-on: https://gerrit.libreoffice.org/65449
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx26
1 files changed, 18 insertions, 8 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 706f6c60265f..00b631688b14 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 ) );
}
@@ -3381,14 +3381,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 ),