From d0aaad22a95d96f4da2c930d98bdba138d4e15a1 Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Tue, 29 Oct 2019 16:55:40 +0100 Subject: tdf#128432 OOXML chart import: fix x axis scale regression of 3D charts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: László Németh --- xmloff/source/chart/SchXMLAxisContext.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'xmloff/source/chart') 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(); -- cgit