chart2/source/inc/Diagram.hxx | 2 ++ chart2/source/inc/DiagramHelper.hxx | 1 - chart2/source/model/main/Diagram.cxx | 6 ++++++ chart2/source/tools/AxisHelper.cxx | 2 +- chart2/source/tools/DiagramHelper.cxx | 6 ------ chart2/source/view/main/SeriesPlotterContainer.cxx | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-)
New commits: commit 0bb487ae390b29fd75258cae6fb3a7645fefcc86 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Mar 15 16:34:10 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Mar 18 12:01:29 2023 +0000 move isSupportingDateAxis inside chart2::Diagram Change-Id: I6c0d6d68c08cc66bff6666c6ff8189d2e7e24c39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149079 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/chart2/source/inc/Diagram.hxx b/chart2/source/inc/Diagram.hxx index adae9200d0e6..d28ad7bd0575 100644 --- a/chart2/source/inc/Diagram.hxx +++ b/chart2/source/inc/Diagram.hxx @@ -224,6 +224,8 @@ public: rtl::Reference< ChartType > getChartTypeByIndex( sal_Int32 nIndex ); + bool isSupportingDateAxis(); + private: // ____ XModifyListener ____ virtual void SAL_CALL modified( diff --git a/chart2/source/inc/DiagramHelper.hxx b/chart2/source/inc/DiagramHelper.hxx index 09fdb8960a97..0e02db670287 100644 --- a/chart2/source/inc/DiagramHelper.hxx +++ b/chart2/source/inc/DiagramHelper.hxx @@ -204,7 +204,6 @@ public: static void switchToTextCategories( const rtl::Reference<::chart::ChartModel> & xChartDoc ); - static bool isSupportingDateAxis( const rtl::Reference< ::chart::Diagram >& xDiagram ); static bool isDateNumberFormat( sal_Int32 nNumberFormat, const css::uno::Reference< css::util::XNumberFormats >& xNumberFormats ); static sal_Int32 getDateNumberFormat( const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier ); static sal_Int32 getDateTimeInputNumberFormat( const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier, double fNumber ); diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 55e96fab6685..daf1b91970d4 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -1060,6 +1060,12 @@ rtl::Reference< ChartType > Diagram::getChartTypeByIndex( sal_Int32 nIndex ) return xChartType; } +bool Diagram::isSupportingDateAxis() +{ + return ::chart::ChartTypeHelper::isSupportingDateAxis( getChartTypeByIndex( 0 ), 0 ); +} + + } // namespace chart diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index 5a1a0088d6ab..5fd8de93dcf7 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -194,7 +194,7 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis( else if( xChartDoc.is() && xChartDoc->hasInternalDataProvider() && nDimensionIndex == 0 ) //maybe date axis { rtl::Reference< Diagram > xDiagram( xChartDoc->getFirstChartDiagram() ); - if( DiagramHelper::isSupportingDateAxis( xDiagram ) ) + if( xDiagram->isSupportingDateAxis() ) { nNumberFormatKey = DiagramHelper::getDateNumberFormat( xChartDoc ); } diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index f81e1449d140..cf27162c936c 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -968,12 +968,6 @@ void DiagramHelper::switchToTextCategories( const rtl::Reference<::chart::ChartM } } -bool DiagramHelper::isSupportingDateAxis( const rtl::Reference< Diagram >& xDiagram ) -{ - return ::chart::ChartTypeHelper::isSupportingDateAxis( - xDiagram->getChartTypeByIndex( 0 ), 0 ); -} - bool DiagramHelper::isDateNumberFormat( sal_Int32 nNumberFormat, const Reference< util::XNumberFormats >& xNumberFormats ) { bool bIsDate = false; diff --git a/chart2/source/view/main/SeriesPlotterContainer.cxx b/chart2/source/view/main/SeriesPlotterContainer.cxx index 6bba86eb61e9..c9e0b7239aea 100644 --- a/chart2/source/view/main/SeriesPlotterContainer.cxx +++ b/chart2/source/view/main/SeriesPlotterContainer.cxx @@ -135,7 +135,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart return; uno::Reference<util::XNumberFormatsSupplier> xNumberFormatsSupplier(&rChartModel); - if (rChartModel.hasInternalDataProvider() && DiagramHelper::isSupportingDateAxis(xDiagram)) + if (rChartModel.hasInternalDataProvider() && xDiagram->isSupportingDateAxis()) m_nDefaultDateNumberFormat = DiagramHelper::getDateNumberFormat(xNumberFormatsSupplier); sal_Int32 nDimensionCount = DiagramHelper::getDimension(xDiagram);