summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/ITiledRenderable.hxx6
-rw-r--r--sc/inc/docuno.hxx3
-rw-r--r--sc/source/ui/unoobj/docuno.cxx13
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx2
4 files changed, 20 insertions, 4 deletions
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index dcd3b5e97d07..2a42f1956c6d 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 557c1d354608..56fc762099c2 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -418,6 +418,9 @@ public:
/// @see vcl::ITiledRenderable::getWindow().
virtual vcl::Window* getWindow() SAL_OVERRIDE;
+
+ /// @see vcl::ITiledRenderable::isMimeTypeSupported().
+ virtual bool isMimeTypeSupported() SAL_OVERRIDE;
};
class ScDrawPagesObj : public cppu::WeakImplHelper2<
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index fa335335cfca..9489a07bccc2 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -842,6 +842,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 94cd065334f0..578fedad9ef6 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3197,6 +3197,8 @@ vcl::Window* SwXTextDocument::getWindow()
bool SwXTextDocument::isMimeTypeSupported()
{
+ SolarMutexGuard aGuard;
+
SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
if (!pWrtShell)
return false;