summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-24 11:02:42 +0200
committerNoel Grandin <noel@peralex.com>2016-05-24 11:02:42 +0200
commit95d20a3799998b9816bd2e8aebdbc96c61cead3e (patch)
tree8206ecc848631432cb8b027d5e780483734f808a /sd
parent3caf31b05d7bbf3d50a1bbda6c8b95982cb5c2b5 (diff)
Revert "remove some manual ref-counting"
until I have a better understanding of the UNO reference counting. This reverts commit 111de438ea3e512a541281dc0716cc728ea8d152.
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx2
-rw-r--r--sd/source/ui/inc/OutlineViewShell.hxx2
-rw-r--r--sd/source/ui/view/drviews7.cxx7
-rw-r--r--sd/source/ui/view/drviewsa.cxx10
-rw-r--r--sd/source/ui/view/outlnvsh.cxx15
5 files changed, 20 insertions, 16 deletions
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index e5288089da14..b96a0e2bfd6f 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;
- css::uno::Reference<TransferableClipboardListener> mxClipEvtLstnr;
+ TransferableClipboardListener* mpClipEvtLstnr;
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 01a57a305ac9..b57bc50151fa 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
- css::uno::Reference<TransferableClipboardListener> mxClipEvtLstnr;
+ TransferableClipboardListener* pClipEvtLstnr;
bool bPastePossible;
bool mbInitialized;
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index a774b113c429..cd3162ec40e2 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 ( !mxClipEvtLstnr.is() )
+ if ( !mpClipEvtLstnr )
{
// avoid clipboard initialization for
// read-only presentation views (workaround for NT4.0
@@ -616,8 +616,9 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if( dynamic_cast< const PresentationViewShell *>( this ) == nullptr )
{
// create listener
- mxClipEvtLstnr = new TransferableClipboardListener( LINK( this, DrawViewShell, ClipboardChanged ) );
- mxClipEvtLstnr->AddRemoveListener( GetActiveWindow(), true );
+ mpClipEvtLstnr = new TransferableClipboardListener( LINK( this, DrawViewShell, ClipboardChanged ) );
+ mpClipEvtLstnr->acquire();
+ mpClipEvtLstnr->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 afa1c293533f..52cd788cf58a 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -177,11 +177,11 @@ DrawViewShell::~DrawViewShell()
}
}
- if ( mxClipEvtLstnr.is() )
+ if ( mpClipEvtLstnr )
{
- mxClipEvtLstnr->AddRemoveListener( GetActiveWindow(), false );
- mxClipEvtLstnr->ClearCallbackLink(); // prevent callback if another thread is waiting
- mxClipEvtLstnr.clear();
+ mpClipEvtLstnr->AddRemoveListener( GetActiveWindow(), false );
+ mpClipEvtLstnr->ClearCallbackLink(); // prevent callback if another thread is waiting
+ mpClipEvtLstnr->release();
}
delete mpDrawView;
@@ -201,7 +201,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
mpActualPage = nullptr;
mbMousePosFreezed = false;
mbReadOnly = GetDocSh()->IsReadOnly();
- mxClipEvtLstnr.clear();
+ mpClipEvtLstnr = nullptr;
mbPastePossible = false;
mbIsLayerModeActive = false;
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 3f35f85cfec8..86f71567221a 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -191,6 +191,7 @@ OutlineViewShell::OutlineViewShell (
: ViewShell(pFrame, pParentWindow, rViewShellBase),
pOlView(nullptr),
pLastPage( nullptr ),
+ pClipEvtLstnr(nullptr),
bPastePossible(false),
mbInitialized(false)
@@ -219,10 +220,11 @@ OutlineViewShell::~OutlineViewShell()
mpFrameView->Disconnect();
- if ( mxClipEvtLstnr.is() )
+ if ( pClipEvtLstnr )
{
- mxClipEvtLstnr->AddRemoveListener( GetActiveWindow(), false );
- mxClipEvtLstnr->ClearCallbackLink(); // prevent callback if another thread is waiting
+ pClipEvtLstnr->AddRemoveListener( GetActiveWindow(), false );
+ pClipEvtLstnr->ClearCallbackLink(); // prevent callback if another thread is waiting
+ pClipEvtLstnr->release();
}
}
@@ -881,11 +883,12 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
if( SfxItemState::DEFAULT == rSet.GetItemState( SID_PASTE ) )
{
- if ( !mxClipEvtLstnr.is() )
+ if ( !pClipEvtLstnr )
{
// create listener
- mxClipEvtLstnr = new TransferableClipboardListener( LINK( this, OutlineViewShell, ClipboardChanged ) );
- mxClipEvtLstnr->AddRemoveListener( GetActiveWindow(), true );
+ pClipEvtLstnr = new TransferableClipboardListener( LINK( this, OutlineViewShell, ClipboardChanged ) );
+ pClipEvtLstnr->acquire();
+ pClipEvtLstnr->AddRemoveListener( GetActiveWindow(), true );
// get initial state
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) );