diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-28 20:38:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-29 09:55:59 +0000 |
commit | 0af8c811ccd297539c56f03af8353175671e189c (patch) | |
tree | 2ffa5620ddc5b1d7a8f5c08a98e96804f63d31be /chart2 | |
parent | 1f93816dd5d75aca98f210017d0b58b7ef1d08da (diff) |
use more concrete types in chart2
Change-Id: I286ad05252bb34f7a1b8f7c08190bddc601faf3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149680
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/inc/ChartModel.hxx | 3 | ||||
-rw-r--r-- | chart2/source/inc/ChartModelHelper.hxx | 3 | ||||
-rw-r--r-- | chart2/source/model/main/ChartModel.cxx | 21 | ||||
-rw-r--r-- | chart2/source/tools/ChartModelHelper.cxx | 6 |
4 files changed, 19 insertions, 14 deletions
diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx index c8b34562e0b4..1255c4982d14 100644 --- a/chart2/inc/ChartModel.hxx +++ b/chart2/inc/ChartModel.hxx @@ -76,6 +76,7 @@ class ChartTypeTemplate; class InternalDataProvider; class NameContainer; class PageBackground; +class RangeHighlighter; class Title; namespace impl @@ -147,7 +148,7 @@ private: //the content of this should be always synchronized with the current m_xViewWindow size. The variable is necessary to hold the information as long as no view window exists. css::awt::Size m_aVisualAreaSize; css::uno::Reference< css::frame::XModel > m_xParent; - css::uno::Reference< css::chart2::data::XRangeHighlighter > m_xRangeHighlighter; + rtl::Reference< ::chart::RangeHighlighter > m_xRangeHighlighter; css::uno::Reference<css::awt::XRequestCallback> m_xPopupRequest; std::vector< GraphicObject > m_aGraphicObjectVector; diff --git a/chart2/source/inc/ChartModelHelper.hxx b/chart2/source/inc/ChartModelHelper.hxx index 10523dc2d3a7..a49aec9f2c66 100644 --- a/chart2/source/inc/ChartModelHelper.hxx +++ b/chart2/source/inc/ChartModelHelper.hxx @@ -46,9 +46,6 @@ class InternalDataProvider; class OOO_DLLPUBLIC_CHARTTOOLS ChartModelHelper { public: - static css::uno::Reference< css::chart2::data::XRangeHighlighter > createRangeHighlighter( - const rtl::Reference< ::chart::ChartModel >& xSelectionSupplier ); - static rtl::Reference< InternalDataProvider > createInternalDataProvider( const rtl::Reference<::chart::ChartModel>& xChartDoc, bool bConnectToModel ); diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index b56dc1d74981..7c319603a0cc 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -35,6 +35,7 @@ #include <ChartView.hxx> #include <PopupRequest.hxx> #include <ModifyListenerHelper.hxx> +#include <RangeHighlighter.hxx> #include <Diagram.hxx> #include <dumpxmltostring.hxx> @@ -394,7 +395,11 @@ void SAL_CALL ChartModel::disconnectController( const uno::Reference< frame::XCo if( m_xCurrentController == xController ) m_xCurrentController.clear(); - DisposeHelper::DisposeAndClear( m_xRangeHighlighter ); + if (m_xRangeHighlighter) + { + m_xRangeHighlighter->dispose(); + m_xRangeHighlighter.clear(); + } DisposeHelper::DisposeAndClear(m_xPopupRequest); } @@ -479,7 +484,11 @@ void SAL_CALL ChartModel::setCurrentController( const uno::Reference< frame::XCo m_xCurrentController = xController; - DisposeHelper::DisposeAndClear( m_xRangeHighlighter ); + if (m_xRangeHighlighter) + { + m_xRangeHighlighter->dispose(); + m_xRangeHighlighter.clear(); + } DisposeHelper::DisposeAndClear(m_xPopupRequest); } @@ -560,7 +569,11 @@ void SAL_CALL ChartModel::dispose() m_aControllers.disposeAndClear( lang::EventObject( static_cast< cppu::OWeakObject * >( this ))); m_xCurrentController.clear(); - DisposeHelper::DisposeAndClear( m_xRangeHighlighter ); + if (m_xRangeHighlighter) + { + m_xRangeHighlighter->dispose(); + m_xRangeHighlighter.clear(); + } DisposeHelper::DisposeAndClear(m_xPopupRequest); if( m_xOldModelAgg.is()) @@ -877,7 +890,7 @@ Reference< chart2::data::XDataSource > SAL_CALL ChartModel::getUsedData() Reference< chart2::data::XRangeHighlighter > SAL_CALL ChartModel::getRangeHighlighter() { if( ! m_xRangeHighlighter.is()) - m_xRangeHighlighter.set( ChartModelHelper::createRangeHighlighter( this )); + m_xRangeHighlighter = new RangeHighlighter( this ); return m_xRangeHighlighter; } diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx index 0b80b6e6f925..59d8da22bb2d 100644 --- a/chart2/source/tools/ChartModelHelper.cxx +++ b/chart2/source/tools/ChartModelHelper.cxx @@ -41,12 +41,6 @@ namespace chart using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; -uno::Reference< chart2::data::XRangeHighlighter > ChartModelHelper::createRangeHighlighter( - const rtl::Reference< ChartModel > & xSelectionSupplier ) -{ - return new RangeHighlighter( xSelectionSupplier ); -} - rtl::Reference< InternalDataProvider > ChartModelHelper::createInternalDataProvider( const rtl::Reference<::chart::ChartModel>& xChartDoc, bool bConnectToModel ) { |