diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-29 10:06:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-29 13:00:24 +0000 |
commit | 6213787202570f783458a2d00351851ad46150d7 (patch) | |
tree | b20ad126a18422ad45e4c585523b8c16c06030c7 /chart2 | |
parent | 23c2fb9dbfa5b3eca64ba8aef1a82f9c60d39397 (diff) |
use more concrete types in chart2
Change-Id: Id665050f4f0763505e7f1ace6ade5bf9ab02edf1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149686
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/inc/ChartViewHelper.hxx | 14 | ||||
-rw-r--r-- | chart2/source/model/main/UndoManager.cxx | 13 | ||||
-rw-r--r-- | chart2/source/model/main/UndoManager.hxx | 3 | ||||
-rw-r--r-- | chart2/source/tools/ChartViewHelper.cxx | 10 |
4 files changed, 18 insertions, 22 deletions
diff --git a/chart2/source/inc/ChartViewHelper.hxx b/chart2/source/inc/ChartViewHelper.hxx index 54d23e8107a0..06fef6a1ff9b 100644 --- a/chart2/source/inc/ChartViewHelper.hxx +++ b/chart2/source/inc/ChartViewHelper.hxx @@ -19,22 +19,16 @@ #pragma once #include "charttoolsdllapi.hxx" - -namespace com::sun::star::uno -{ -template <class interface_type> class Reference; -} -namespace com::sun::star::frame -{ -class XModel; -} +#include <rtl/ref.hxx> namespace chart { +class ChartModel; + class OOO_DLLPUBLIC_CHARTTOOLS ChartViewHelper { public: - static void setViewToDirtyState(const css::uno::Reference<css::frame::XModel>& xChartModel); + static void setViewToDirtyState(const rtl::Reference<::chart::ChartModel>& xChartModel); }; } //namespace chart diff --git a/chart2/source/model/main/UndoManager.cxx b/chart2/source/model/main/UndoManager.cxx index 63dacf48444c..a756e7440a75 100644 --- a/chart2/source/model/main/UndoManager.cxx +++ b/chart2/source/model/main/UndoManager.cxx @@ -18,6 +18,7 @@ */ #include "UndoManager.hxx" +#include <ChartModel.hxx> #include <ChartViewHelper.hxx> #include <com/sun/star/frame/XModel.hpp> @@ -49,7 +50,7 @@ namespace chart class UndoManager_Impl : public ::framework::IUndoManagerImplementation { public: - UndoManager_Impl( UndoManager& i_antiImpl, ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ) + UndoManager_Impl( UndoManager& i_antiImpl, ::chart::ChartModel& i_parent, ::osl::Mutex& i_mutex ) :m_rAntiImpl( i_antiImpl ) ,m_rParent( i_parent ) ,m_rMutex( i_mutex ) @@ -70,7 +71,7 @@ namespace chart virtual Reference< XUndoManager > getThis() override; // attribute access - ::cppu::OWeakObject& getParent() { return m_rParent; } + ::chart::ChartModel& getParent() { return m_rParent; } ::framework::UndoManagerHelper& getUndoHelper() { return m_aUndoHelper; } // public interface @@ -83,7 +84,7 @@ namespace chart private: UndoManager& m_rAntiImpl; - ::cppu::OWeakObject& m_rParent; + ::chart::ChartModel& m_rParent; ::osl::Mutex& m_rMutex; bool m_bDisposed; @@ -172,7 +173,7 @@ namespace chart using impl::UndoManagerMethodGuard; - UndoManager::UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ) + UndoManager::UndoManager( ::chart::ChartModel& i_parent, ::osl::Mutex& i_mutex ) :m_pImpl( new impl::UndoManager_Impl( *this, i_parent, i_mutex ) ) { } @@ -225,7 +226,7 @@ namespace chart UndoManagerMethodGuard aGuard( *m_pImpl ); m_pImpl->getUndoHelper().undo( aGuard ); - ChartViewHelper::setViewToDirtyState( Reference< XModel >( getParent(), UNO_QUERY ) ); + ChartViewHelper::setViewToDirtyState( &m_pImpl->getParent() ); } void SAL_CALL UndoManager::redo( ) @@ -233,7 +234,7 @@ namespace chart UndoManagerMethodGuard aGuard( *m_pImpl ); m_pImpl->getUndoHelper().redo( aGuard ); - ChartViewHelper::setViewToDirtyState( Reference< XModel >( getParent(), UNO_QUERY ) ); + ChartViewHelper::setViewToDirtyState( &m_pImpl->getParent() ); } sal_Bool SAL_CALL UndoManager::isUndoPossible( ) diff --git a/chart2/source/model/main/UndoManager.hxx b/chart2/source/model/main/UndoManager.hxx index 4d0a214e5a70..c20dcef6643d 100644 --- a/chart2/source/model/main/UndoManager.hxx +++ b/chart2/source/model/main/UndoManager.hxx @@ -28,6 +28,7 @@ namespace chart { +class ChartModel; namespace impl { @@ -40,7 +41,7 @@ namespace chart class UndoManager : public impl::UndoManager_Base { public: - UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ); + UndoManager( ::chart::ChartModel& i_parent, ::osl::Mutex& i_mutex ); virtual ~UndoManager(); // XInterface diff --git a/chart2/source/tools/ChartViewHelper.cxx b/chart2/source/tools/ChartViewHelper.cxx index 67dc781892ad..183d28189531 100644 --- a/chart2/source/tools/ChartViewHelper.cxx +++ b/chart2/source/tools/ChartViewHelper.cxx @@ -18,6 +18,7 @@ */ #include <ChartViewHelper.hxx> +#include <ChartModel.hxx> #include <servicenames.hxx> #include <com/sun/star/frame/XModel.hpp> @@ -30,18 +31,17 @@ namespace chart using namespace ::com::sun::star; using ::com::sun::star::uno::Reference; -void ChartViewHelper::setViewToDirtyState(const uno::Reference<frame::XModel>& xChartModel) +void ChartViewHelper::setViewToDirtyState(const rtl::Reference<::chart::ChartModel>& xChartModel) { try { - uno::Reference<lang::XMultiServiceFactory> xFact(xChartModel, uno::UNO_QUERY); - if (xFact.is()) + if (xChartModel.is()) { Reference<util::XModifyListener> xModifyListener( - xFact->createInstance(CHART_VIEW_SERVICE_NAME), uno::UNO_QUERY); + xChartModel->createInstance(CHART_VIEW_SERVICE_NAME), uno::UNO_QUERY); if (xModifyListener.is()) { - lang::EventObject aEvent(xChartModel); + lang::EventObject aEvent(static_cast<cppu::OWeakObject*>(xChartModel.get())); xModifyListener->modified(aEvent); } } |