diff options
author | Tünde Tóth <tundeth@gmail.com> | 2020-04-22 16:00:49 +0200 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2020-04-28 14:53:39 +0200 |
commit | 50670fc723066c0598ed8f482c575bfb290d6a05 (patch) | |
tree | ed208c82f06197e0b9d597a538e97b72cd8b9bb5 /chart2/source | |
parent | 47c2a85b41d669281b0e9f0063f024360485f0d5 (diff) |
tdf#132355 fix X axis position of stock charts
Set the ShiftedCategoryPosition for true in case of stock chart.
Regression from commit: 111c260ab2883b7906f1a66e222dbf4dc3c58c4f
(tdf#127777 OOXML chart export: fix "CrossBetween" for not imported charts)
Change-Id: I7ced1b03158908e838f7bb44c89dea23c5b347b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92759
Reviewed-by: Balazs Varga <balazs.varga991@gmail.com>
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93045
Tested-by: Jenkins
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/inc/ChartTypeHelper.hxx | 1 | ||||
-rw-r--r-- | chart2/source/model/template/ChartTypeTemplate.cxx | 5 | ||||
-rw-r--r-- | chart2/source/tools/ChartTypeHelper.cxx | 13 |
3 files changed, 1 insertions, 18 deletions
diff --git a/chart2/source/inc/ChartTypeHelper.hxx b/chart2/source/inc/ChartTypeHelper.hxx index b4af58240460..f9ba155b397e 100644 --- a/chart2/source/inc/ChartTypeHelper.hxx +++ b/chart2/source/inc/ChartTypeHelper.hxx @@ -46,7 +46,6 @@ public: static bool isSupportingStartingAngle( const css::uno::Reference< css::chart2::XChartType >& xChartType ); //starting value for bars or baseline for areas for example static bool isSupportingBaseValue( const css::uno::Reference< css::chart2::XChartType >& xChartType ); - static bool shiftCategoryPosAtXAxisPerDefault( const css::uno::Reference< css::chart2::XChartType >& xChartType ); static bool isSupportingAxisPositioning( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex ); static bool isSupportingDateAxis( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionIndex ); static bool isSupportingComplexCategory( const css::uno::Reference< css::chart2::XChartType >& xChartType ); diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index afd9eb0f048a..cb7a0d387500 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -626,10 +626,7 @@ void ChartTypeTemplate::adaptScales( Reference< XChartType > xChartType(getChartTypeForNewSeries(Sequence< Reference< XChartType > >())); if( aData.AxisType == AxisType::CATEGORY ) { - if( !m_aServiceName.endsWith("ColumnWithLine") ) - aData.ShiftedCategoryPosition = ::chart::ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault(xChartType); - else - aData.ShiftedCategoryPosition = true; + aData.ShiftedCategoryPosition = m_aServiceName.indexOf("Column") != -1 || m_aServiceName.indexOf("Bar") != -1 || m_aServiceName.endsWith("Close"); } bool bSupportsDates = ::chart::ChartTypeHelper::isSupportingDateAxis( xChartType, nDimensionX ); if( aData.AxisType != AxisType::CATEGORY && ( aData.AxisType != AxisType::DATE || !bSupportsDates) ) diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx index ebd2af04ab45..be46b0f19ac5 100644 --- a/chart2/source/tools/ChartTypeHelper.cxx +++ b/chart2/source/tools/ChartTypeHelper.cxx @@ -430,19 +430,6 @@ bool ChartTypeHelper::isSupportingComplexCategory( const uno::Reference< chart2: return true; } -bool ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault( const uno::Reference< chart2::XChartType >& xChartType ) -{ - if(xChartType.is()) - { - OUString aChartTypeName = xChartType->getChartType(); - if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) - || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR) - || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) ) - return true; - } - return false; -} - bool ChartTypeHelper::noBordersForSimpleScheme( const uno::Reference< chart2::XChartType >& xChartType ) { if(xChartType.is()) |