diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-21 13:33:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-21 16:10:51 +0100 |
commit | 7ffb71e759e5d29a505188d1cbf506dd57383a4a (patch) | |
tree | e1828c9b7a800cc51b4b16898b0303fc1789211b /forms/source/richtext | |
parent | 6dccc6b54e4bb13f765d494bcdcdd782fa11fe38 (diff) |
loplugin:refcounting in forms
Change-Id: I19d67e54f77e354eaddaaa7de1f3e22c2b7cdbf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111280
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms/source/richtext')
-rw-r--r-- | forms/source/richtext/richtextcontrol.cxx | 6 | ||||
-rw-r--r-- | forms/source/richtext/richtextmodel.cxx | 2 | ||||
-rw-r--r-- | forms/source/richtext/richtextmodel.hxx | 2 |
3 files changed, 4 insertions, 6 deletions
diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index ad857d328685..45e898b8ed13 100644 --- a/forms/source/richtext/richtextcontrol.cxx +++ b/forms/source/richtext/richtextcontrol.cxx @@ -442,8 +442,8 @@ namespace frm if ( !pRichTextControl ) return SingleAttributeDispatcher( nullptr ); - ORichTextFeatureDispatcher* pDispatcher = nullptr; - OAttributeDispatcher* pAttributeDispatcher = nullptr; + rtl::Reference<ORichTextFeatureDispatcher> pDispatcher; + rtl::Reference<OAttributeDispatcher> pAttributeDispatcher; switch ( _nSlotId ) { case SID_CUT: @@ -547,7 +547,7 @@ namespace frm if ( pAttributeDispatcher ) { xDispatcher = SingleAttributeDispatcher( pAttributeDispatcher ); - pRichTextControl->enableAttributeNotification( _nSlotId, pAttributeDispatcher ); + pRichTextControl->enableAttributeNotification( _nSlotId, pAttributeDispatcher.get() ); } return xDispatcher; diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx index ece2d36e96fe..9e33fb2118dd 100644 --- a/forms/source/richtext/richtextmodel.cxx +++ b/forms/source/richtext/richtextmodel.cxx @@ -136,7 +136,7 @@ namespace frm nEngineControlWord = nEngineControlWord & ~EEControlBits::AUTOPAGESIZE; m_pEngine->SetControlWord( nEngineControlWord ); - VCLXDevice* pUnoRefDevice = new VCLXDevice; + rtl::Reference<VCLXDevice> pUnoRefDevice = new VCLXDevice; { SolarMutexGuard g; pUnoRefDevice->SetOutputDevice( m_pEngine->GetRefDevice() ); diff --git a/forms/source/richtext/richtextmodel.hxx b/forms/source/richtext/richtextmodel.hxx index 493fbda75807..ef3aff536fb9 100644 --- a/forms/source/richtext/richtextmodel.hxx +++ b/forms/source/richtext/richtextmodel.hxx @@ -101,8 +101,6 @@ namespace frm public: static RichTextEngine* getEditEngine( const css::uno::Reference< css::awt::XControlModel >& _rxModel ); - private: - // UNO DECLARE_UNO3_AGG_DEFAULTS( ORichTextModel, OControlModel ) virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& _rType ) override; |