diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-01-18 21:13:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-19 07:06:52 +0100 |
commit | 25298b632f31b02b664c72fac91ae77d1531a9db (patch) | |
tree | 3491af5080494447288d35502940f40b265960e7 /chart2 | |
parent | 65c4b292afda53c1fffd9be3b88d4a5c535149ca (diff) |
use more concrete types in chart2, PageBackground
Change-Id: I432b77bab48c8574373daa00916ef6ceea4ebc93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128576
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/inc/ChartModel.hxx | 4 | ||||
-rw-r--r-- | chart2/source/model/main/ChartModel.cxx | 9 | ||||
-rw-r--r-- | chart2/source/model/main/PageBackground.hxx | 3 |
3 files changed, 9 insertions, 7 deletions
diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx index 0a6587d93d74..e1bba2124dbe 100644 --- a/chart2/inc/ChartModel.hxx +++ b/chart2/inc/ChartModel.hxx @@ -72,6 +72,7 @@ namespace chart class Diagram; class ChartTypeManager; class NameContainer; +class PageBackground; namespace impl { @@ -166,8 +167,7 @@ private: css::uno::Reference< css::chart2::XTitle > m_xTitle; - css::uno::Reference< css::beans::XPropertySet > - m_xPageBackground; + rtl::Reference< ::chart::PageBackground > m_xPageBackground; rtl::Reference< ::chart::NameContainer > m_xXMLNamespaceMap; diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 33501965bc48..00aee342a50d 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -109,7 +109,7 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext) } { - ModifyListenerHelper::addListener( m_xPageBackground, this ); + m_xPageBackground->addModifyListener( this ); m_xChartTypeManager = new ::chart::ChartTypeManager( m_xContext ); } osl_atomic_decrement(&m_refCount); @@ -150,7 +150,7 @@ ChartModel::ChartModel( const ChartModel & rOther ) Reference< util::XModifyListener > xListener; Reference< chart2::XTitle > xNewTitle = CreateRefClone< chart2::XTitle >()( rOther.m_xTitle ); rtl::Reference< ::chart::Diagram > xNewDiagram = new ::chart::Diagram( *rOther.m_xDiagram ); - Reference< beans::XPropertySet > xNewPageBackground = CreateRefClone< beans::XPropertySet >()( rOther.m_xPageBackground ); + rtl::Reference< ::chart::PageBackground > xNewPageBackground = new PageBackground( *rOther.m_xPageBackground ); rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager; // does not implement XCloneable rtl::Reference< ::chart::NameContainer > xXMLNamespaceMap = new NameContainer( *rOther.m_xXMLNamespaceMap ); @@ -167,7 +167,8 @@ ChartModel::ChartModel( const ChartModel & rOther ) ModifyListenerHelper::addListener( xNewTitle, xListener ); if( xNewDiagram && xListener) xNewDiagram->addModifyListener( xListener ); - ModifyListenerHelper::addListener( xNewPageBackground, xListener ); + if( xNewPageBackground && xListener) + xNewPageBackground->addModifyListener( xListener ); xListener.clear(); } osl_atomic_decrement(&m_refCount); @@ -542,7 +543,7 @@ void SAL_CALL ChartModel::dispose() m_xChartTypeManager.clear(); m_xDiagram.clear(); DisposeHelper::DisposeAndClear( m_xTitle ); - DisposeHelper::DisposeAndClear( m_xPageBackground ); + m_xPageBackground.clear(); m_xXMLNamespaceMap.clear(); m_xStorage.clear(); diff --git a/chart2/source/model/main/PageBackground.hxx b/chart2/source/model/main/PageBackground.hxx index e8b340122301..3bc2dcfd0224 100644 --- a/chart2/source/model/main/PageBackground.hxx +++ b/chart2/source/model/main/PageBackground.hxx @@ -56,7 +56,6 @@ public: /// merge XInterface implementations DECLARE_XINTERFACE() -private: explicit PageBackground( const PageBackground & rOther ); // ____ OPropertySet ____ @@ -78,6 +77,8 @@ private: virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override; +private: + // ____ XModifyListener ____ virtual void SAL_CALL modified( const css::lang::EventObject& aEvent ) override; |