Blame SOURCES/0231-sc-implement-vcl-ITiledRenderable-isMimeTypeSupporte.patch

f325b2
From ce5f6c1ac1880ff18eb3b663a2862f742a6ddad4 Mon Sep 17 00:00:00 2001
f325b2
From: Miklos Vajna <vmiklos@collabora.co.uk>
f325b2
Date: Mon, 26 Oct 2015 13:42:02 +0100
f325b2
Subject: [PATCH 231/398] sc: implement
f325b2
 vcl::ITiledRenderable::isMimeTypeSupported()
f325b2
f325b2
(cherry picked from commit 5b4c29b1b15dcebfe4e76aaa8bdb2dd45e2b67f3)
f325b2
f325b2
Change-Id: I0b9de068ddf0f4ff92d8fbf003b7529516f1f80a
f325b2
---
f325b2
 include/vcl/ITiledRenderable.hxx  |  6 ++----
f325b2
 sc/inc/docuno.hxx                 |  8 +++++++-
f325b2
 sc/source/ui/unoobj/docuno.cxx    | 24 ++++++++++++++++++++++++
f325b2
 sw/source/uibase/uno/unotxdoc.cxx |  2 ++
f325b2
 4 files changed, 35 insertions(+), 5 deletions(-)
f325b2
f325b2
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
f325b2
index 3301b7754f15..4fa23386bfbc 100644
f325b2
--- a/include/vcl/ITiledRenderable.hxx
f325b2
+++ b/include/vcl/ITiledRenderable.hxx
f325b2
@@ -151,10 +151,8 @@ public:
f325b2
     /// Returns the current vcl::Window of the component.
f325b2
     virtual vcl::Window* getWindow() = 0;
f325b2
 
f325b2
-    virtual bool isMimeTypeSupported()
f325b2
-    {
f325b2
-        return false;
f325b2
-    }
f325b2
+    /// If the current contents of the clipboard is something we can paste.
f325b2
+    virtual bool isMimeTypeSupported() = 0;
f325b2
 };
f325b2
 
f325b2
 } // namespace vcl
f325b2
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
f325b2
index cc132278bdf8..1e3aae1d302b 100644
f325b2
--- a/sc/inc/docuno.hxx
f325b2
+++ b/sc/inc/docuno.hxx
f325b2
@@ -414,7 +414,13 @@ public:
f325b2
     virtual void setGraphicSelection(int nType, int nX, int nY) SAL_OVERRIDE;
f325b2
 
f325b2
     /// @see lok::Document::resetSelection().
f325b2
-    virtual void resetSelection() SAL_OVERRIDE;
f325b2
+    virtual void resetSelection() override;
f325b2
+
f325b2
+    /// @see vcl::ITiledRenderable::getWindow().
f325b2
+    virtual vcl::Window* getWindow() override;
f325b2
+
f325b2
+    /// @see vcl::ITiledRenderable::isMimeTypeSupported().
f325b2
+    virtual bool isMimeTypeSupported() override;
f325b2
 };
f325b2
 
f325b2
 class ScDrawPagesObj : public cppu::WeakImplHelper2<
f325b2
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
f325b2
index 958495f7ea7b..af6bd11ba742 100644
f325b2
--- a/sc/source/ui/unoobj/docuno.cxx
f325b2
+++ b/sc/source/ui/unoobj/docuno.cxx
f325b2
@@ -846,6 +846,30 @@ void ScModelObj::resetSelection()
f325b2
     pDocShell->GetDocument().GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, "");
f325b2
 }
f325b2
 
f325b2
+vcl::Window* ScModelObj::getWindow()
f325b2
+{
f325b2
+    SolarMutexGuard aGuard;
f325b2
+
f325b2
+    ScViewData* pViewData = ScDocShell::GetViewData();
f325b2
+    if (!pViewData)
f325b2
+        return 0;
f325b2
+
f325b2
+    return pViewData->GetActiveWin();
f325b2
+}
f325b2
+
f325b2
+bool ScModelObj::isMimeTypeSupported()
f325b2
+{
f325b2
+    SolarMutexGuard aGuard;
f325b2
+
f325b2
+    ScViewData* pViewData = ScDocShell::GetViewData();
f325b2
+    if (!pViewData)
f325b2
+        return 0;
f325b2
+
f325b2
+
f325b2
+    TransferableDataHelper aDataHelper(TransferableDataHelper::CreateFromSystemClipboard(pViewData->GetActiveWin()));
f325b2
+    return EditEngine::HasValidData(aDataHelper.GetTransferable());
f325b2
+}
f325b2
+
f325b2
 void ScModelObj::initializeForTiledRendering()
f325b2
 {
f325b2
     SolarMutexGuard aGuard;
f325b2
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
f325b2
index 618e6b373162..68ec3df2a9c0 100644
f325b2
--- a/sw/source/uibase/uno/unotxdoc.cxx
f325b2
+++ b/sw/source/uibase/uno/unotxdoc.cxx
f325b2
@@ -3197,6 +3197,8 @@ vcl::Window* SwXTextDocument::getWindow()
f325b2
 
f325b2
 bool SwXTextDocument::isMimeTypeSupported()
f325b2
 {
f325b2
+    SolarMutexGuard aGuard;
f325b2
+
f325b2
     SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
f325b2
     if (!pWrtShell)
f325b2
         return false;
f325b2
-- 
f325b2
2.12.0
f325b2