Kaydet (Commit) 5b4c29b1 authored tarafından Miklos Vajna's avatar Miklos Vajna

sc: implement vcl::ITiledRenderable::isMimeTypeSupported()

Change-Id: I0b9de068ddf0f4ff92d8fbf003b7529516f1f80a
üst b08546eb
......@@ -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
......
......@@ -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<
......
......@@ -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;
......
......@@ -3191,6 +3191,8 @@ vcl::Window* SwXTextDocument::getWindow()
bool SwXTextDocument::isMimeTypeSupported()
{
SolarMutexGuard aGuard;
SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
if (!pWrtShell)
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment