diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-01-26 19:22:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-27 19:45:48 +0100 |
commit | 0e570fafd319c6567d798ff9e5530099c53312ee (patch) | |
tree | bf2b019441174e163213f43db5893401e07ab196 | |
parent | 883ae88f297fc83a5a47a85dbcd1802a15e8eb3c (diff) |
use more concrete types in chart2, BaseCoordinateSystem
Change-Id: I76c3c094e94a21b65034dbc80bf98e4b4e3f57af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129054
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | chart2/source/inc/DiagramHelper.hxx | 9 | ||||
-rw-r--r-- | chart2/source/tools/ChartTypeHelper.cxx | 1 | ||||
-rw-r--r-- | chart2/source/tools/DiagramHelper.cxx | 19 |
3 files changed, 14 insertions, 15 deletions
diff --git a/chart2/source/inc/DiagramHelper.hxx b/chart2/source/inc/DiagramHelper.hxx index 9f40c536e241..6da483d2f39e 100644 --- a/chart2/source/inc/DiagramHelper.hxx +++ b/chart2/source/inc/DiagramHelper.hxx @@ -42,6 +42,7 @@ namespace com::sun::star::util { class XNumberFormatsSupplier; } namespace chart { +class BaseCoordinateSystem; class ChartType; class ChartTypeManager; class ChartTypeTemplate; @@ -119,7 +120,7 @@ public: static StackMode getStackModeFromChartType( const rtl::Reference< ::chart::ChartType > & xChartType, bool& rbFound, bool& rbAmbiguous, - const css::uno::Reference< css::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem + const rtl::Reference< ::chart::BaseCoordinateSystem > & xCorrespondingCoordinateSystem ); /** Returns the dimension found for all chart types in the tree. If the @@ -144,8 +145,8 @@ public: */ SAL_DLLPRIVATE static void replaceCoordinateSystem( const rtl::Reference< ::chart::Diagram > & xDiagram, - const css::uno::Reference< css::chart2::XCoordinateSystem > & xCooSysToReplace, - const css::uno::Reference< css::chart2::XCoordinateSystem > & xReplacement ); + const rtl::Reference< ::chart::BaseCoordinateSystem > & xCooSysToReplace, + const rtl::Reference< ::chart::BaseCoordinateSystem > & xReplacement ); static bool isSeriesAttachedToMainAxis( const css::uno::Reference< css::chart2::XDataSeries >& xDataSeries ); @@ -195,7 +196,7 @@ public: SAL_DLLPRIVATE static css::uno::Sequence< OUString > generateAutomaticCategoriesFromCooSys( - const css::uno::Reference< css::chart2::XCoordinateSystem > & xCooSys ); + const rtl::Reference< ::chart::BaseCoordinateSystem > & xCooSys ); static void switchToDateCategories( const rtl::Reference<::chart::ChartModel> & xChartDoc ); diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx index 0942953be7ce..289d7adf150d 100644 --- a/chart2/source/tools/ChartTypeHelper.cxx +++ b/chart2/source/tools/ChartTypeHelper.cxx @@ -19,6 +19,7 @@ #include <ChartTypeHelper.hxx> #include <ChartType.hxx> +#include <BaseCoordinateSystem.hxx> #include <DiagramHelper.hxx> #include <servicenames_charttypes.hxx> diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index 99618fdd44d2..04c049dc2228 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -325,7 +325,7 @@ StackMode DiagramHelper::getStackMode( const rtl::Reference< Diagram > & xDiagra StackMode DiagramHelper::getStackModeFromChartType( const rtl::Reference< ChartType > & xChartType, bool& rbFound, bool& rbAmbiguous, - const Reference< XCoordinateSystem > & xCorrespondingCoordinateSystem ) + const rtl::Reference< BaseCoordinateSystem > & xCorrespondingCoordinateSystem ) { StackMode eStackMode = StackMode::NONE; rbFound = false; @@ -485,8 +485,8 @@ void DiagramHelper::setDimension( void DiagramHelper::replaceCoordinateSystem( const rtl::Reference< Diagram > & xDiagram, - const Reference< XCoordinateSystem > & xCooSysToReplace, - const Reference< XCoordinateSystem > & xReplacement ) + const rtl::Reference< BaseCoordinateSystem > & xCooSysToReplace, + const rtl::Reference< BaseCoordinateSystem > & xReplacement ) { OSL_ASSERT( xDiagram.is()); if( ! xDiagram.is()) @@ -499,9 +499,7 @@ void DiagramHelper::replaceCoordinateSystem( Reference< chart2::data::XLabeledDataSequence > xCategories = DiagramHelper::getCategoriesFromDiagram( xDiagram ); // move chart types of xCooSysToReplace to xReplacement - Reference< XChartTypeContainer > xCTCntCooSys( xCooSysToReplace, uno::UNO_QUERY_THROW ); - Reference< XChartTypeContainer > xCTCntReplacement( xReplacement, uno::UNO_QUERY_THROW ); - xCTCntReplacement->setChartTypes( xCTCntCooSys->getChartTypes()); + xReplacement->setChartTypes( xCooSysToReplace->getChartTypes()); xDiagram->removeCoordinateSystem( xCooSysToReplace ); xDiagram->addCoordinateSystem( xReplacement ); @@ -863,15 +861,14 @@ static void lcl_generateAutomaticCategoriesFromChartType( } } -Sequence< OUString > DiagramHelper::generateAutomaticCategoriesFromCooSys( const Reference< XCoordinateSystem > & xCooSys ) +Sequence< OUString > DiagramHelper::generateAutomaticCategoriesFromCooSys( const rtl::Reference< BaseCoordinateSystem > & xCooSys ) { Sequence< OUString > aRet; - Reference< XChartTypeContainer > xTypeCntr( xCooSys, uno::UNO_QUERY ); - if( xTypeCntr.is() ) + if( xCooSys.is() ) { - const Sequence< Reference< XChartType > > aChartTypes( xTypeCntr->getChartTypes() ); - for( Reference< XChartType > const & chartType : aChartTypes ) + const std::vector< rtl::Reference< ChartType > > & aChartTypes( xCooSys->getChartTypes2() ); + for( rtl::Reference< ChartType > const & chartType : aChartTypes ) { lcl_generateAutomaticCategoriesFromChartType( aRet, chartType ); if( aRet.hasElements() ) |