diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-23 13:53:42 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-24 06:54:06 +0000 |
commit | 111de438ea3e512a541281dc0716cc728ea8d152 (patch) | |
tree | 2c9ca866e79ed0cfc9299e553a87239345c515a6 /sd/source/ui/view/drviews7.cxx | |
parent | d3f21849ec8580fdb59a1f0b35453657f4050e0f (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: Ie1abeaed75c1f861df185e3bde680272dbadc97f
Reviewed-on: https://gerrit.libreoffice.org/25363
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sd/source/ui/view/drviews7.cxx')
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index cd3162ec40e2..a774b113c429 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -608,7 +608,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) SfxItemState::DEFAULT == rSet.GetItemState( SID_PASTE_UNFORMATTED ) || SfxItemState::DEFAULT == rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) ) { - if ( !mpClipEvtLstnr ) + if ( !mxClipEvtLstnr.is() ) { // avoid clipboard initialization for // read-only presentation views (workaround for NT4.0 @@ -616,9 +616,8 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) if( dynamic_cast< const PresentationViewShell *>( this ) == nullptr ) { // create listener - mpClipEvtLstnr = new TransferableClipboardListener( LINK( this, DrawViewShell, ClipboardChanged ) ); - mpClipEvtLstnr->acquire(); - mpClipEvtLstnr->AddRemoveListener( GetActiveWindow(), true ); + mxClipEvtLstnr = new TransferableClipboardListener( LINK( this, DrawViewShell, ClipboardChanged ) ); + mxClipEvtLstnr->AddRemoveListener( GetActiveWindow(), true ); // get initial state TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) ); |