summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-10-28 09:44:37 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-03 16:36:24 +0100
commit155044c76e5baa2c6d5193a0a8bb5165daae8095 (patch)
tree4279865d31ee8ea02d07569e33e6e4cda7db9f1a
parent4a669a434527d07f49bf2a35796ee4b421952bf6 (diff)
vcl: getWindow() -> setClipboard() in ITiledRenderable
It's cleaner to let the apps do this themselves than exposing their underlying vcl::Window. (cherry picked from commit bfd79be417358822023691cf7b7b2946906100ca) Conflicts: sc/inc/docuno.hxx sd/source/ui/inc/unomodel.hxx sw/inc/unotxdoc.hxx Change-Id: Iff2442dd325fa65a0cf3ad4aa7f918542dab1e4c
-rw-r--r--desktop/source/lib/init.cxx9
-rw-r--r--include/vcl/ITiledRenderable.hxx4
-rw-r--r--sc/inc/docuno.hxx4
-rw-r--r--sc/source/ui/unoobj/docuno.cxx6
-rw-r--r--sd/source/ui/inc/unomodel.hxx4
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx6
-rw-r--r--sw/inc/unotxdoc.hxx4
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx4
8 files changed, 17 insertions, 24 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 7eb7f52fca61..a3c4872ea00b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1097,14 +1097,7 @@ static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, cons
uno::Reference<datatransfer::XTransferable> xTransferable(new LOKTransferable(pMimeType, pData, nSize));
uno::Reference<datatransfer::clipboard::XClipboard> xClipboard(new LOKClipboard());
xClipboard->setContents(xTransferable, uno::Reference<datatransfer::clipboard::XClipboardOwner>());
- vcl::Window* pWindow = pDoc->getWindow();
- if (!pWindow)
- {
- gImpl->maLastExceptionMsg = "Document did not provide a window";
- return false;
- }
-
- pWindow->SetClipboard(xClipboard);
+ pDoc->setClipboard(xClipboard);
if (!pDoc->isMimeTypeSupported())
{
if (gImpl)
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 2a42f1956c6d..1bf14d860629 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -148,8 +148,8 @@ public:
return OUString();
}
- /// Returns the current vcl::Window of the component.
- virtual vcl::Window* getWindow() = 0;
+ /// Sets the clipboard of the component.
+ virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) = 0;
/// If the current contents of the clipboard is something we can paste.
virtual bool isMimeTypeSupported() = 0;
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 56fc762099c2..8123a0ecea8b 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -416,8 +416,8 @@ public:
/// @see lok::Document::resetSelection().
virtual void resetSelection() SAL_OVERRIDE;
- /// @see vcl::ITiledRenderable::getWindow().
- virtual vcl::Window* getWindow() SAL_OVERRIDE;
+ /// @see vcl::ITiledRenderable::setClipboard().
+ virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::isMimeTypeSupported().
virtual bool isMimeTypeSupported() SAL_OVERRIDE;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 9489a07bccc2..66ac7ec63ff6 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -831,15 +831,15 @@ void ScModelObj::resetSelection()
pDocShell->GetDocument().GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, "");
}
-vcl::Window* ScModelObj::getWindow()
+void ScModelObj::setClipboard(const uno::Reference<datatransfer::clipboard::XClipboard>& xClipboard)
{
SolarMutexGuard aGuard;
ScViewData* pViewData = ScDocShell::GetViewData();
if (!pViewData)
- return 0;
+ return;
- return pViewData->GetActiveWin();
+ pViewData->GetActiveWin()->SetClipboard(xClipboard);
}
bool ScModelObj::isMimeTypeSupported()
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index 107069ed2dcc..14162e371828 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -258,8 +258,8 @@ public:
virtual void setGraphicSelection(int nType, int nX, int nY) SAL_OVERRIDE;
/// @see lok::Document::resetSelection().
virtual void resetSelection() SAL_OVERRIDE;
- /// @see vcl::ITiledRenderable::getWindow().
- virtual vcl::Window* getWindow() SAL_OVERRIDE;
+ /// @see vcl::ITiledRenderable::setClipboard().
+ virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::isMimeTypeSupported().
virtual bool isMimeTypeSupported() SAL_OVERRIDE;
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 31954b68f114..d2c6b5e37603 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2539,15 +2539,15 @@ void SdXImpressDocument::resetSelection()
pSdrView->UnmarkAll();
}
-vcl::Window* SdXImpressDocument::getWindow()
+void SdXImpressDocument::setClipboard(const uno::Reference<datatransfer::clipboard::XClipboard>& xClipboard)
{
SolarMutexGuard aGuard;
DrawViewShell* pViewShell = GetViewShell();
if (!pViewShell)
- return 0;
+ return;
- return pViewShell->GetActiveWindow();
+ pViewShell->GetActiveWindow()->SetClipboard(xClipboard);
}
bool SdXImpressDocument::isMimeTypeSupported()
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index e590e2da3ce4..4a3307b276a0 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -434,8 +434,8 @@ public:
virtual void resetSelection() SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::getPartPageRectangles().
virtual OUString getPartPageRectangles() SAL_OVERRIDE;
- /// @see vcl::ITiledRenderable::getWindow().
- virtual vcl::Window* getWindow() SAL_OVERRIDE;
+ /// @see vcl::ITiledRenderable::setClipboard().
+ virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::isMimeTypeSupported().
virtual bool isMimeTypeSupported() SAL_OVERRIDE;
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 2a3c894915a8..58a61e849c9b 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3188,11 +3188,11 @@ OUString SwXTextDocument::getPartPageRectangles()
return pWrtShell->getPageRectangles();
}
-vcl::Window* SwXTextDocument::getWindow()
+void SwXTextDocument::setClipboard(const uno::Reference<datatransfer::clipboard::XClipboard>& xClipboard)
{
SolarMutexGuard aGuard;
- return &pDocShell->GetView()->GetEditWin();
+ pDocShell->GetView()->GetEditWin().SetClipboard(xClipboard);
}
bool SwXTextDocument::isMimeTypeSupported()