diff options
author | Noel Grandin <noel@peralex.com> | 2016-06-01 16:22:29 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-06 07:01:34 +0000 |
commit | 0323253a7c67316cb96e4a64792ab4fe74aac1ca (patch) | |
tree | 81787c4ae44ff778aa41e12574cd60a624c9277b /sd/source/ui/view/outlnvsh.cxx | |
parent | 4d666f5092d7c4f2ece9702dda4d874e44cdc6f7 (diff) |
remove some manual ref-counting
triggered when I noticed a class doing acquire() in the
constructor and then release() in the destructor.
found mostly by
git grep -n -B5 -e '->release()'
Change-Id: I96e43a3d30ffd9ae9a34275f24cd914d8f7b026f
Reviewed-on: https://gerrit.libreoffice.org/25806
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sd/source/ui/view/outlnvsh.cxx')
-rw-r--r-- | sd/source/ui/view/outlnvsh.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 23922b525621..f0708bec378d 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -190,7 +190,6 @@ OutlineViewShell::OutlineViewShell ( : ViewShell(pFrame, pParentWindow, rViewShellBase), pOlView(nullptr), pLastPage( nullptr ), - pClipEvtLstnr(nullptr), bPastePossible(false), mbInitialized(false) @@ -219,11 +218,10 @@ OutlineViewShell::~OutlineViewShell() mpFrameView->Disconnect(); - if ( pClipEvtLstnr ) + if ( mxClipEvtLstnr.is() ) { - pClipEvtLstnr->AddRemoveListener( GetActiveWindow(), false ); - pClipEvtLstnr->ClearCallbackLink(); // prevent callback if another thread is waiting - pClipEvtLstnr->release(); + mxClipEvtLstnr->AddRemoveListener( GetActiveWindow(), false ); + mxClipEvtLstnr->ClearCallbackLink(); // prevent callback if another thread is waiting } } @@ -881,12 +879,11 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) if( SfxItemState::DEFAULT == rSet.GetItemState( SID_PASTE ) ) { - if ( !pClipEvtLstnr ) + if ( !mxClipEvtLstnr.is() ) { // create listener - pClipEvtLstnr = new TransferableClipboardListener( LINK( this, OutlineViewShell, ClipboardChanged ) ); - pClipEvtLstnr->acquire(); - pClipEvtLstnr->AddRemoveListener( GetActiveWindow(), true ); + mxClipEvtLstnr = new TransferableClipboardListener( LINK( this, OutlineViewShell, ClipboardChanged ) ); + mxClipEvtLstnr->AddRemoveListener( GetActiveWindow(), true ); // get initial state TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) ); |