diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-26 13:42:02 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-26 13:42:02 +0100 |
commit | 5b4c29b1b15dcebfe4e76aaa8bdb2dd45e2b67f3 (patch) | |
tree | b27831fb48a1424404e53027ccfe3b5b679bb602 | |
parent | b08546eb23aa8dfc2f139731f800031f147e32d7 (diff) |
sc: implement vcl::ITiledRenderable::isMimeTypeSupported()
Change-Id: I0b9de068ddf0f4ff92d8fbf003b7529516f1f80a
-rw-r--r-- | include/vcl/ITiledRenderable.hxx | 6 | ||||
-rw-r--r-- | sc/inc/docuno.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 13 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 2 |
4 files changed, 20 insertions, 4 deletions
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index 3301b7754f15..4fa23386bfbc 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -151,10 +151,8 @@ public: /// Returns the current vcl::Window of the component. virtual vcl::Window* getWindow() = 0; - virtual bool isMimeTypeSupported() - { - return false; - } + /// If the current contents of the clipboard is something we can paste. + virtual bool isMimeTypeSupported() = 0; }; } // namespace vcl diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 3369cbed0edb..92cf89fa339e 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -415,6 +415,9 @@ public: /// @see vcl::ITiledRenderable::getWindow(). virtual vcl::Window* getWindow() override; + + /// @see vcl::ITiledRenderable::isMimeTypeSupported(). + virtual bool isMimeTypeSupported() override; }; class ScDrawPagesObj : public cppu::WeakImplHelper< diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index cfd7957c31db..d89d0ae3ad60 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -856,6 +856,19 @@ vcl::Window* ScModelObj::getWindow() return pViewData->GetActiveWin(); } +bool ScModelObj::isMimeTypeSupported() +{ + SolarMutexGuard aGuard; + + ScViewData* pViewData = ScDocShell::GetViewData(); + if (!pViewData) + return 0; + + + TransferableDataHelper aDataHelper(TransferableDataHelper::CreateFromSystemClipboard(pViewData->GetActiveWin())); + return EditEngine::HasValidData(aDataHelper.GetTransferable()); +} + void ScModelObj::initializeForTiledRendering() { SolarMutexGuard aGuard; diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index a8eec89917dc..d41458214b58 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3191,6 +3191,8 @@ vcl::Window* SwXTextDocument::getWindow() bool SwXTextDocument::isMimeTypeSupported() { + SolarMutexGuard aGuard; + SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); if (!pWrtShell) return false; |