summaryrefslogtreecommitdiff
path: root/sc/source/ui/undo/undoblk.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/undo/undoblk.cxx')
-rw-r--r--sc/source/ui/undo/undoblk.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 1141e75655b7..291151d11a6d 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1080,11 +1080,10 @@ void ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell* pViewSh = static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
- ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pViewSh->GetActiveWin() );
+ // keep a reference in case the clipboard is changed during PasteFromClip
+ rtl::Reference<ScTransferObj> pOwnClip = ScTransferObj::GetOwnClipboard( pViewSh->GetActiveWin() );
if (pOwnClip)
{
- // keep a reference in case the clipboard is changed during PasteFromClip
- css::uno::Reference<css::datatransfer::XTransferable> aOwnClipRef( pOwnClip );
pViewSh->PasteFromClip( nFlags, pOwnClip->GetDocument(),
aPasteOptions.nFunction, aPasteOptions.bSkipEmpty, aPasteOptions.bTranspose,
aPasteOptions.bAsLink, aPasteOptions.eMoveMode, InsertDeleteFlags::NONE,