summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2019-10-29 16:55:40 +0100
committerLászló Németh <nemeth@numbertext.org>2019-10-30 10:17:38 +0100
commitd0aaad22a95d96f4da2c930d98bdba138d4e15a1 (patch)
tree4d40f03adec77aa9ad5db8bc23ae948d5d57861f /xmloff
parentf903af07aab03f94e36a74936deef7f28d05a779 (diff)
tdf#128432 OOXML chart import: fix x axis scale regression of 3D charts
Set 3D charts ShiftedCategoryPosition value to default true in case of BarDiagram and StockDiagram. Regression from commit: 111c260ab2883b7906f1a66e222dbf4dc3c58c4f tdf#127777 OOXML chart export: fix "CrossBetween" for not imported charts Change-Id: I5bf0e6f6e7ad96e6c96c01ab18d74d51419f5e3c Reviewed-on: https://gerrit.libreoffice.org/81695 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/chart/SchXMLAxisContext.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx
index aaa3b6f75bf1..931983bc8c01 100644
--- a/xmloff/source/chart/SchXMLAxisContext.cxx
+++ b/xmloff/source/chart/SchXMLAxisContext.cxx
@@ -461,6 +461,25 @@ void SchXMLAxisContext::CreateAxis()
if( m_bAxisTypeImported )
m_xAxisProps->setPropertyValue("AxisType", uno::makeAny(m_nAxisType) );
+ if( m_aCurrentAxis.eDimension == SCH_XML_AXIS_X )
+ {
+ bool bIs3DChart = false;
+ if( (xDiaProp->getPropertyValue("Dim3D") >>= bIs3DChart) && bIs3DChart )
+ {
+ OUString sChartType = m_xDiagram->getDiagramType();
+ if( sChartType == "com.sun.star.chart.BarDiagram" || sChartType == "com.sun.star.chart.StockDiagram" )
+ {
+ Reference< chart2::XAxis > xAxis(lcl_getAxis(GetImport().GetModel(), m_aCurrentAxis.eDimension, m_aCurrentAxis.nAxisIndex));
+ if( xAxis.is() )
+ {
+ chart2::ScaleData aScaleData(xAxis->getScaleData());
+ aScaleData.ShiftedCategoryPosition = true;
+ xAxis->setScaleData(aScaleData);
+ }
+ }
+ }
+ }
+
if( !m_aAutoStyleName.isEmpty())
{
const SvXMLStylesContext* pStylesCtxt = m_rImportHelper.GetAutoStylesContext();