diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-28 14:38:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-28 19:52:51 +0000 |
commit | 90baab0f50bcf35ae29f1841509ecdace9be77db (patch) | |
tree | 6d84c73505c05c2ffe4af9ea23f8dc2b98f95976 | |
parent | ef1f51571654d6449c6ce2872a4bc2bc2475585d (diff) |
use more concrete types in chart2
Change-Id: I067e9424a77fb1d835f2847bba3c3f2cda3430f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149652
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
9 files changed, 13 insertions, 26 deletions
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx index b9ba429433e2..f3ea07e23a3a 100644 --- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx +++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx @@ -26,6 +26,7 @@ #include <ObjectIdentifier.hxx> #include <chartview/ExplicitValueProvider.hxx> #include <chartview/DrawModelWrapper.hxx> +#include <Axis.hxx> #include <AxisHelper.hxx> #include <ChartView.hxx> #include <DiagramHelper.hxx> @@ -151,7 +152,7 @@ void Chart2ModelContact::getExplicitValuesForAxis( } sal_Int32 Chart2ModelContact::getExplicitNumberFormatKeyForAxis( - const Reference< chart2::XAxis >& xAxis ) + const rtl::Reference< ::chart::Axis >& xAxis ) { rtl::Reference< BaseCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis( diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx index 7a89fb7dd06d..505bc1e144e6 100644 --- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx +++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx @@ -75,7 +75,7 @@ public: ExplicitIncrementData & rOutExplicitIncrement ); sal_Int32 getExplicitNumberFormatKeyForAxis( - const css::uno::Reference< css::chart2::XAxis >& xAxis ); + const rtl::Reference< ::chart::Axis >& xAxis ); static sal_Int32 getExplicitNumberFormatKeyForSeries( const css::uno::Reference< css::chart2::XDataSeries >& xSeries ); diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx index ad8d1c942f4f..971e69a585e4 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx @@ -19,6 +19,7 @@ #include "WrappedNumberFormatProperty.hxx" #include "Chart2ModelContact.hxx" +#include <Axis.hxx> #include <com/sun/star/chart2/XAxis.hpp> #include <com/sun/star/chart2/XDataSeries.hpp> #include <unonames.hxx> @@ -68,7 +69,8 @@ Any WrappedNumberFormatProperty::getPropertyValue( const Reference< beans::XProp nKey = Chart2ModelContact::getExplicitNumberFormatKeyForSeries( xSeries ); else { - Reference< chart2::XAxis > xAxis( xInnerPropertySet, uno::UNO_QUERY ); + rtl::Reference< Axis > xAxis = dynamic_cast<Axis*>(xInnerPropertySet.get()); + assert(xAxis || !xInnerPropertySet); nKey = m_spChart2ModelContact->getExplicitNumberFormatKeyForAxis( xAxis ); } aRet <<= nKey; diff --git a/chart2/source/controller/inc/AxisItemConverter.hxx b/chart2/source/controller/inc/AxisItemConverter.hxx index cbb75d2a1db6..c9f3049356a0 100644 --- a/chart2/source/controller/inc/AxisItemConverter.hxx +++ b/chart2/source/controller/inc/AxisItemConverter.hxx @@ -27,6 +27,7 @@ namespace com::sun::star::awt { struct Size; } namespace com::sun::star::beans { class XPropertySet; } namespace com::sun::star::chart2 { class XAxis; } namespace com::sun::star::chart2 { class XChartDocument; } +namespace chart { class Axis; } namespace chart { struct ExplicitIncrementData; } namespace chart { struct ExplicitScaleData; } namespace chart { class ChartModel; } @@ -60,8 +61,7 @@ protected: private: std::vector< std::unique_ptr<ItemConverter> > m_aConverters; - css::uno::Reference< - css::chart2::XAxis > m_xAxis; + rtl::Reference<::chart::Axis> m_xAxis; rtl::Reference<::chart::ChartModel>m_xChartDoc; diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx index 20ad1504f018..436e6e29b71e 100644 --- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -101,8 +101,8 @@ AxisItemConverter::AxisItemConverter( m_aConverters.emplace_back( new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize")); - m_xAxis.set( Reference< chart2::XAxis >( rPropertySet, uno::UNO_QUERY ) ); - OSL_ASSERT( m_xAxis.is()); + m_xAxis = dynamic_cast<::chart::Axis*>(rPropertySet.get()); + assert(m_xAxis); } AxisItemConverter::~AxisItemConverter() diff --git a/chart2/source/inc/AxisHelper.hxx b/chart2/source/inc/AxisHelper.hxx index cd51d5adb3f6..03d67fe3b5dd 100644 --- a/chart2/source/inc/AxisHelper.hxx +++ b/chart2/source/inc/AxisHelper.hxx @@ -59,11 +59,6 @@ public: static css::chart2::ScaleData getDateCheckedScale( const rtl::Reference< ::chart::Axis >& xAxis, ChartModel& rModel ); static sal_Int32 getExplicitNumberFormatKeyForAxis( - const css::uno::Reference< css::chart2::XAxis >& xAxis - , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCorrespondingCoordinateSystem - , const rtl::Reference< ::chart::ChartModel>& xChartDoc - , bool bSearchForParallelAxisIfNothingIsFound ); - static sal_Int32 getExplicitNumberFormatKeyForAxis( const rtl::Reference< ::chart::Axis >& xAxis , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCorrespondingCoordinateSystem , const rtl::Reference< ::chart::ChartModel>& xChartDoc diff --git a/chart2/source/inc/chartview/ExplicitValueProvider.hxx b/chart2/source/inc/chartview/ExplicitValueProvider.hxx index 35b2dd15fa4c..d298c5e49e8a 100644 --- a/chart2/source/inc/chartview/ExplicitValueProvider.hxx +++ b/chart2/source/inc/chartview/ExplicitValueProvider.hxx @@ -41,7 +41,7 @@ class SvxShape; namespace chart { - +class Axis; class BaseCoordinateSystem; class DrawModelWrapper; class ChartModel; @@ -80,7 +80,7 @@ public: , const css::awt::Rectangle& rPositionAndSize, bool bSubtract ); static sal_Int32 getExplicitNumberFormatKeyForAxis( - const css::uno::Reference< css::chart2::XAxis >& xAxis + const rtl::Reference< ::chart::Axis >& xAxis , const rtl::Reference< ::chart::BaseCoordinateSystem > & xCorrespondingCoordinateSystem , const rtl::Reference<::chart::ChartModel>& xChartDoc); diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index cee0547b618f..4eac09bdab4a 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -135,17 +135,6 @@ void AxisHelper::checkDateAxis( chart2::ScaleData& rScale, ExplicitCategoriesPro } sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis( - const Reference< chart2::XAxis >& xAxis - , const rtl::Reference< BaseCoordinateSystem > & xCorrespondingCoordinateSystem - , const rtl::Reference<ChartModel>& xChartDoc - , bool bSearchForParallelAxisIfNothingIsFound ) -{ - rtl::Reference< Axis > pAxis = dynamic_cast<Axis*>(xAxis.get()); - assert(pAxis || !xAxis); - return getExplicitNumberFormatKeyForAxis(pAxis, xCorrespondingCoordinateSystem, xChartDoc, bSearchForParallelAxisIfNothingIsFound); -} - -sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis( const rtl::Reference< Axis >& xAxis , const rtl::Reference< BaseCoordinateSystem > & xCorrespondingCoordinateSystem , const rtl::Reference<ChartModel>& xChartDoc diff --git a/chart2/source/view/main/ExplicitValueProvider.cxx b/chart2/source/view/main/ExplicitValueProvider.cxx index 3479bd3f703b..b768e47b5be0 100644 --- a/chart2/source/view/main/ExplicitValueProvider.cxx +++ b/chart2/source/view/main/ExplicitValueProvider.cxx @@ -68,7 +68,7 @@ bool lcl_getPropertySwapXAndYAxis(const rtl::Reference<Diagram>& xDiagram) } // end anonymous namespace sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis( - const Reference<chart2::XAxis>& xAxis, + const rtl::Reference<::chart::Axis>& xAxis, const rtl::Reference<::chart::BaseCoordinateSystem>& xCorrespondingCoordinateSystem, const rtl::Reference<::chart::ChartModel>& xChartDoc) { |