[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source

Henry Castro hcastro at collabora.com
Wed Feb 21 13:26:12 UTC 2018


 sc/source/ui/app/transobj.cxx |   22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

New commits:
commit 6574ae5c8e8c89ed3b4f7e24db1b2bb8ecf60536
Author: Henry Castro <hcastro at collabora.com>
Date:   Tue Feb 6 17:16:03 2018 -0400

    tdf#115020: Cutting a large dataset is very slow since 6.1.0.0.alpha0+
    
    Change-Id: Icc26224055c00bd826019bd728c3f74d2ebba535
    Reviewed-on: https://gerrit.libreoffice.org/49320
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/49517
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index c17ac0cc7ed1..a7b2e66a54b9 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -23,6 +23,7 @@
 
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
 
 #include <unotools/tempfile.hxx>
 #include <unotools/ucbstreamhelper.hxx>
@@ -200,13 +201,22 @@ ScTransferObj::~ScTransferObj()
 ScTransferObj* ScTransferObj::GetOwnClipboard( vcl::Window* pUIWin )
 {
     ScTransferObj* pObj = nullptr;
-    TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pUIWin ) );
-    uno::Reference<XUnoTunnel> xTunnel( aDataHelper.GetTransferable(), uno::UNO_QUERY );
-    if ( xTunnel.is() )
+    uno::Reference<XTransferable> xTransferable;
+    uno::Reference<datatransfer::clipboard::XClipboard> xClipboard;
+
+    if( pUIWin )
+        xClipboard = pUIWin->GetClipboard();
+
+    if( xClipboard.is() )
     {
-        sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() );
-        if ( nHandle )
-            pObj = dynamic_cast<ScTransferObj*>(reinterpret_cast<TransferableHelper*>( (sal_IntPtr) nHandle ));
+        xTransferable = xClipboard->getContents();
+        uno::Reference<XUnoTunnel> xTunnel( xTransferable, uno::UNO_QUERY );
+        if ( xTunnel.is() )
+        {
+            sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() );
+            if ( nHandle )
+                pObj = dynamic_cast<ScTransferObj*>(reinterpret_cast<TransferableHelper*>( static_cast<sal_IntPtr>(nHandle) ));
+        }
     }
 
     return pObj;


More information about the Libreoffice-commits mailing list