diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/inc/DrawViewShell.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/OutlineViewShell.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsa.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvsh.cxx | 15 |
5 files changed, 16 insertions, 20 deletions
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index b96a0e2bfd6f..0195f3b7459e 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -446,7 +446,7 @@ private: css::uno::Reference< css::scanner::XScannerManager2 > mxScannerManager; css::uno::Reference< css::lang::XEventListener > mxScannerListener; - TransferableClipboardListener* mpClipEvtLstnr; + rtl::Reference<TransferableClipboardListener> mxClipEvtLstnr; bool mbPastePossible; virtual void Notify (SfxBroadcaster& rBC, const SfxHint& rHint) override; diff --git a/sd/source/ui/inc/OutlineViewShell.hxx b/sd/source/ui/inc/OutlineViewShell.hxx index b57bc50151fa..79b03f9b0d36 100644 --- a/sd/source/ui/inc/OutlineViewShell.hxx +++ b/sd/source/ui/inc/OutlineViewShell.hxx @@ -152,7 +152,7 @@ private: void ShowSlideShow(SfxRequest& rReq); OutlineView* pOlView; SdPage* pLastPage; // For efficient processing of the preview - TransferableClipboardListener* pClipEvtLstnr; + rtl::Reference<TransferableClipboardListener> mxClipEvtLstnr; bool bPastePossible; bool mbInitialized; diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index c75417cbb9bf..5f322592be8b 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -604,7 +604,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 @@ -612,9 +612,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() ) ); diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index c356a19e3689..561ca6f899df 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -177,11 +177,11 @@ DrawViewShell::~DrawViewShell() } } - if ( mpClipEvtLstnr ) + if ( mxClipEvtLstnr.is() ) { - mpClipEvtLstnr->AddRemoveListener( GetActiveWindow(), false ); - mpClipEvtLstnr->ClearCallbackLink(); // prevent callback if another thread is waiting - mpClipEvtLstnr->release(); + mxClipEvtLstnr->AddRemoveListener( GetActiveWindow(), false ); + mxClipEvtLstnr->ClearCallbackLink(); // prevent callback if another thread is waiting + mxClipEvtLstnr.clear(); } delete mpDrawView; @@ -201,7 +201,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind) mpActualPage = nullptr; mbMousePosFreezed = false; mbReadOnly = GetDocSh()->IsReadOnly(); - mpClipEvtLstnr = nullptr; + mxClipEvtLstnr.clear(); mbPastePossible = false; mbIsLayerModeActive = false; 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() ) ); |