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: ...@@ -151,10 +151,8 @@ public:
/// Returns the current vcl::Window of the component. /// Returns the current vcl::Window of the component.
virtual vcl::Window* getWindow() = 0; virtual vcl::Window* getWindow() = 0;
virtual bool isMimeTypeSupported() /// If the current contents of the clipboard is something we can paste.
{ virtual bool isMimeTypeSupported() = 0;
return false;
}
}; };
} // namespace vcl } // namespace vcl
......
...@@ -415,6 +415,9 @@ public: ...@@ -415,6 +415,9 @@ public:
/// @see vcl::ITiledRenderable::getWindow(). /// @see vcl::ITiledRenderable::getWindow().
virtual vcl::Window* getWindow() override; virtual vcl::Window* getWindow() override;
/// @see vcl::ITiledRenderable::isMimeTypeSupported().
virtual bool isMimeTypeSupported() override;
}; };
class ScDrawPagesObj : public cppu::WeakImplHelper< class ScDrawPagesObj : public cppu::WeakImplHelper<
......
...@@ -856,6 +856,19 @@ vcl::Window* ScModelObj::getWindow() ...@@ -856,6 +856,19 @@ vcl::Window* ScModelObj::getWindow()
return pViewData->GetActiveWin(); 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() void ScModelObj::initializeForTiledRendering()
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
......
...@@ -3191,6 +3191,8 @@ vcl::Window* SwXTextDocument::getWindow() ...@@ -3191,6 +3191,8 @@ vcl::Window* SwXTextDocument::getWindow()
bool SwXTextDocument::isMimeTypeSupported() bool SwXTextDocument::isMimeTypeSupported()
{ {
SolarMutexGuard aGuard;
SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
if (!pWrtShell) if (!pWrtShell)
return false; 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