summaryrefslogtreecommitdiff
path: root/sc/source/ui/app/drwtrans.cxx
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2018-05-06 22:40:05 -0400
committerEike Rathke <erack@redhat.com>2018-05-23 13:19:20 +0200
commita2e6f31c6f90e446d1462e7c80f6b1317f7825bc (patch)
tree3e009520526d97336d29ba6a45fb1ff22e7b14f5 /sc/source/ui/app/drwtrans.cxx
parent40cf5a9b3dd619a650a94d8b65bf6987125b75fb (diff)
tdf#117228: crash in SfxItemSet::GetItemState...
(unsigned short, bool, SfxPoolItem const**) when pasting comment of closed document Re-work commit 1b7a8277aa3e9f73ccdf15e933a1ee3b42849a44. In the tiled rendering case, each view has its own clipboard, but not in desktop version which it has a shared clipboard each view. Change-Id: I57b1ab81e4c141829dbad899330e5c22204c384a Reviewed-on: https://gerrit.libreoffice.org/53922 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/app/drwtrans.cxx')
-rw-r--r--sc/source/ui/app/drwtrans.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 0f6d0d62a0da..8d00e3f59f65 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -236,16 +236,18 @@ ScDrawTransferObj::~ScDrawTransferObj()
m_pDragSourceView.reset();
}
-ScDrawTransferObj* ScDrawTransferObj::GetOwnClipboard( vcl::Window* pWin )
+ScDrawTransferObj* ScDrawTransferObj::GetOwnClipboard(const uno::Reference<datatransfer::XTransferable2>& xTransferable)
{
ScDrawTransferObj* pObj = nullptr;
- TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pWin ) );
- uno::Reference<XUnoTunnel> xTunnel( aDataHelper.GetTransferable(), uno::UNO_QUERY );
- if ( xTunnel.is() )
+ if (xTransferable.is())
{
- sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() );
- if ( nHandle )
- pObj = dynamic_cast<ScDrawTransferObj*>(reinterpret_cast<TransferableHelper*>( static_cast<sal_IntPtr>(nHandle) ));
+ uno::Reference<XUnoTunnel> xTunnel( xTransferable, uno::UNO_QUERY );
+ if ( xTunnel.is() )
+ {
+ sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() );
+ if ( nHandle )
+ pObj = dynamic_cast<ScDrawTransferObj*>(reinterpret_cast<TransferableHelper*>( static_cast<sal_IntPtr>(nHandle) ));
+ }
}
return pObj;