summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-06-07 11:20:50 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-08 06:39:19 +0000
commit5dd00fedb49f86564f93f07f89faabcb6fad87f6 (patch)
treee0951a8263d023986f511a284e1abfc8ff1223d8 /reportdesign
parente626ebf50884520b38137a52a6ffc654c377956d (diff)
remove some manual refcounting in reportdesign
Change-Id: I660b94acaf07f7ff79b787a6e7bbbcbdbeae0ac0 Reviewed-on: https://gerrit.libreoffice.org/26009 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/ui/inc/ReportController.hxx6
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx18
2 files changed, 10 insertions, 14 deletions
diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx
index fc8dcd9c7fb6..4082efb9766a 100644
--- a/reportdesign/source/ui/inc/ReportController.hxx
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -90,11 +90,11 @@ namespace rptui
css::uno::Sequence< css::beans::PropertyValue>
m_aCollapsedSections;
TransferableDataHelper m_aSystemClipboard; // content of the clipboard
- TransferableClipboardListener*
- m_pClipbordNotifier; /// notifier for changes in the clipboard
+ rtl::Reference<TransferableClipboardListener>
+ m_pClipboardNotifier; /// notifier for changes in the clipboard
VclPtr<OGroupsSortingDialog> m_pGroupsFloater;
- OXReportControllerObserver* m_pReportControllerObserver;
+ rtl::Reference<OXReportControllerObserver> m_pReportControllerObserver;
ODesignView* getDesignView() const { return static_cast< ODesignView* >( getView() ); }
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index ef8531868df1..63bd2b597833 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -276,7 +276,6 @@ OReportController::OReportController(Reference< XComponentContext > const & xCon
:OReportController_BASE(xContext)
,OPropertyStateContainer(OGenericUnoController_Base::rBHelper)
,m_aSelectionListeners( getMutex() )
- ,m_pClipbordNotifier(nullptr)
,m_pGroupsFloater(nullptr)
,m_sMode("normal")
,m_nSplitPos(-1)
@@ -297,7 +296,6 @@ OReportController::OReportController(Reference< XComponentContext > const & xCon
{
// new Observer
m_pReportControllerObserver = new OXReportControllerObserver(*this);
- m_pReportControllerObserver->acquire();
registerProperty("ZoomValue", PROPERTY_ID_ZOOMVALUE,
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::TRANSIENT,
&m_nZoomValue, ::cppu::UnoType<sal_Int16>::get());
@@ -314,12 +312,11 @@ IMPLEMENT_FORWARD_XINTERFACE2(OReportController,OReportController_BASE,OReportCo
void OReportController::disposing()
{
- if ( m_pClipbordNotifier )
+ if ( m_pClipboardNotifier.is() )
{
- m_pClipbordNotifier->ClearCallbackLink();
- m_pClipbordNotifier->AddRemoveListener( getView(), false );
- m_pClipbordNotifier->release();
- m_pClipbordNotifier = nullptr;
+ m_pClipboardNotifier->ClearCallbackLink();
+ m_pClipboardNotifier->AddRemoveListener( getView(), false );
+ m_pClipboardNotifier.clear();
}
if ( m_pGroupsFloater )
{
@@ -356,7 +353,7 @@ void OReportController::disposing()
if ( m_aReportModel )
listen(false);
m_pReportControllerObserver->Clear();
- m_pReportControllerObserver->release();
+ m_pReportControllerObserver.clear();
}
catch(const uno::Exception&)
{
@@ -1768,9 +1765,8 @@ bool OReportController::Construct(vcl::Window* pParent)
// now that we have a view we can create the clipboard listener
m_aSystemClipboard = TransferableDataHelper::CreateFromSystemClipboard( getView() );
m_aSystemClipboard.StartClipboardListening( );
- m_pClipbordNotifier = new TransferableClipboardListener( LINK( this, OReportController, OnClipboardChanged ) );
- m_pClipbordNotifier->acquire();
- m_pClipbordNotifier->AddRemoveListener( getView(), true );
+ m_pClipboardNotifier = new TransferableClipboardListener( LINK( this, OReportController, OnClipboardChanged ) );
+ m_pClipboardNotifier->AddRemoveListener( getView(), true );
OReportController_BASE::Construct(pParent);
return true;