Blame SOURCES/0239-vcl-getWindow-setClipboard-in-ITiledRenderable.patch

f325b2
From 857dfce43c26d197beaa330cd4f005ce2cfb5360 Mon Sep 17 00:00:00 2001
f325b2
From: Miklos Vajna <vmiklos@collabora.co.uk>
f325b2
Date: Wed, 28 Oct 2015 09:44:37 +0100
f325b2
Subject: [PATCH 239/398] vcl: getWindow() -> setClipboard() in
f325b2
 ITiledRenderable
f325b2
f325b2
It's cleaner to let the apps do this themselves than exposing their
f325b2
underlying vcl::Window.
f325b2
f325b2
Change-Id: Iff2442dd325fa65a0cf3ad4aa7f918542dab1e4c
f325b2
(cherry picked from commit bfd79be417358822023691cf7b7b2946906100ca)
f325b2
---
f325b2
 desktop/source/lib/init.cxx       | 9 +--------
f325b2
 include/vcl/ITiledRenderable.hxx  | 4 ++--
f325b2
 sc/inc/docuno.hxx                 | 4 ++--
f325b2
 sc/source/ui/unoobj/docuno.cxx    | 6 +++---
f325b2
 sd/source/ui/inc/unomodel.hxx     | 4 ++--
f325b2
 sd/source/ui/unoidl/unomodel.cxx  | 6 +++---
f325b2
 sw/inc/unotxdoc.hxx               | 4 ++--
f325b2
 sw/source/uibase/uno/unotxdoc.cxx | 4 ++--
f325b2
 8 files changed, 17 insertions(+), 24 deletions(-)
f325b2
f325b2
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
f325b2
index 75df1528fd51..80c3d0389504 100644
f325b2
--- a/desktop/source/lib/init.cxx
f325b2
+++ b/desktop/source/lib/init.cxx
f325b2
@@ -1008,14 +1008,7 @@ static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, cons
f325b2
     uno::Reference<datatransfer::XTransferable> xTransferable(new LOKTransferable(pMimeType, pData, nSize));
f325b2
     uno::Reference<datatransfer::clipboard::XClipboard> xClipboard(new LOKClipboard());
f325b2
     xClipboard->setContents(xTransferable, uno::Reference<datatransfer::clipboard::XClipboardOwner>());
f325b2
-    vcl::Window* pWindow = pDoc->getWindow();
f325b2
-    if (!pWindow)
f325b2
-    {
f325b2
-        gImpl->maLastExceptionMsg = "Document did not provide a window";
f325b2
-        return false;
f325b2
-    }
f325b2
-
f325b2
-    pWindow->SetClipboard(xClipboard);
f325b2
+    pDoc->setClipboard(xClipboard);
f325b2
     if (!pDoc->isMimeTypeSupported())
f325b2
     {
f325b2
         if (gImpl)
f325b2
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
f325b2
index 4fa23386bfbc..8ae719edf752 100644
f325b2
--- a/include/vcl/ITiledRenderable.hxx
f325b2
+++ b/include/vcl/ITiledRenderable.hxx
f325b2
@@ -148,8 +148,8 @@ public:
f325b2
         return OUString();
f325b2
     }
f325b2
 
f325b2
-    /// Returns the current vcl::Window of the component.
f325b2
-    virtual vcl::Window* getWindow() = 0;
f325b2
+    /// Sets the clipboard of the component.
f325b2
+    virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) = 0;
f325b2
 
f325b2
     /// If the current contents of the clipboard is something we can paste.
f325b2
     virtual bool isMimeTypeSupported() = 0;
f325b2
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
f325b2
index 1e3aae1d302b..a8595b00c36e 100644
f325b2
--- a/sc/inc/docuno.hxx
f325b2
+++ b/sc/inc/docuno.hxx
f325b2
@@ -416,8 +416,8 @@ public:
f325b2
     /// @see lok::Document::resetSelection().
f325b2
     virtual void resetSelection() override;
f325b2
 
f325b2
-    /// @see vcl::ITiledRenderable::getWindow().
f325b2
-    virtual vcl::Window* getWindow() override;
f325b2
+    /// @see vcl::ITiledRenderable::setClipboard().
f325b2
+    virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) override;
f325b2
 
f325b2
     /// @see vcl::ITiledRenderable::isMimeTypeSupported().
f325b2
     virtual bool isMimeTypeSupported() override;
f325b2
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
f325b2
index af6bd11ba742..d58d6a900856 100644
f325b2
--- a/sc/source/ui/unoobj/docuno.cxx
f325b2
+++ b/sc/source/ui/unoobj/docuno.cxx
f325b2
@@ -846,15 +846,15 @@ void ScModelObj::resetSelection()
f325b2
     pDocShell->GetDocument().GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, "");
f325b2
 }
f325b2
 
f325b2
-vcl::Window* ScModelObj::getWindow()
f325b2
+void ScModelObj::setClipboard(const uno::Reference<datatransfer::clipboard::XClipboard>& xClipboard)
f325b2
 {
f325b2
     SolarMutexGuard aGuard;
f325b2
 
f325b2
     ScViewData* pViewData = ScDocShell::GetViewData();
f325b2
     if (!pViewData)
f325b2
-        return 0;
f325b2
+        return;
f325b2
 
f325b2
-    return pViewData->GetActiveWin();
f325b2
+    pViewData->GetActiveWin()->SetClipboard(xClipboard);
f325b2
 }
f325b2
 
f325b2
 bool ScModelObj::isMimeTypeSupported()
f325b2
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
f325b2
index 741cfd356e39..8178aab1f1fa 100644
f325b2
--- a/sd/source/ui/inc/unomodel.hxx
f325b2
+++ b/sd/source/ui/inc/unomodel.hxx
f325b2
@@ -258,8 +258,8 @@ public:
f325b2
     virtual void setGraphicSelection(int nType, int nX, int nY) SAL_OVERRIDE;
f325b2
     /// @see lok::Document::resetSelection().
f325b2
     virtual void resetSelection() override;
f325b2
-    /// @see vcl::ITiledRenderable::getWindow().
f325b2
-    virtual vcl::Window* getWindow() override;
f325b2
+    /// @see vcl::ITiledRenderable::setClipboard().
f325b2
+    virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) override;
f325b2
     /// @see vcl::ITiledRenderable::isMimeTypeSupported().
f325b2
     virtual bool isMimeTypeSupported() override;
f325b2
 
f325b2
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
f325b2
index 31954b68f114..d2c6b5e37603 100644
f325b2
--- a/sd/source/ui/unoidl/unomodel.cxx
f325b2
+++ b/sd/source/ui/unoidl/unomodel.cxx
f325b2
@@ -2539,15 +2539,15 @@ void SdXImpressDocument::resetSelection()
f325b2
     pSdrView->UnmarkAll();
f325b2
 }
f325b2
 
f325b2
-vcl::Window* SdXImpressDocument::getWindow()
f325b2
+void SdXImpressDocument::setClipboard(const uno::Reference<datatransfer::clipboard::XClipboard>& xClipboard)
f325b2
 {
f325b2
     SolarMutexGuard aGuard;
f325b2
 
f325b2
     DrawViewShell* pViewShell = GetViewShell();
f325b2
     if (!pViewShell)
f325b2
-        return 0;
f325b2
+        return;
f325b2
 
f325b2
-    return pViewShell->GetActiveWindow();
f325b2
+    pViewShell->GetActiveWindow()->SetClipboard(xClipboard);
f325b2
 }
f325b2
 
f325b2
 bool SdXImpressDocument::isMimeTypeSupported()
f325b2
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
f325b2
index 180ceb891b89..85605d56c60f 100644
f325b2
--- a/sw/inc/unotxdoc.hxx
f325b2
+++ b/sw/inc/unotxdoc.hxx
f325b2
@@ -434,8 +434,8 @@ public:
f325b2
     virtual void resetSelection() SAL_OVERRIDE;
f325b2
     /// @see vcl::ITiledRenderable::getPartPageRectangles().
f325b2
     virtual OUString getPartPageRectangles() override;
f325b2
-    /// @see vcl::ITiledRenderable::getWindow().
f325b2
-    virtual vcl::Window* getWindow() override;
f325b2
+    /// @see vcl::ITiledRenderable::setClipboard().
f325b2
+    virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) override;
f325b2
     /// @see vcl::ITiledRenderable::isMimeTypeSupported().
f325b2
     virtual bool isMimeTypeSupported() override;
f325b2
 
f325b2
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
f325b2
index b50096bbbaa8..4de023d1275c 100644
f325b2
--- a/sw/source/uibase/uno/unotxdoc.cxx
f325b2
+++ b/sw/source/uibase/uno/unotxdoc.cxx
f325b2
@@ -3188,11 +3188,11 @@ OUString SwXTextDocument::getPartPageRectangles()
f325b2
     return pWrtShell->getPageRectangles();
f325b2
 }
f325b2
 
f325b2
-vcl::Window* SwXTextDocument::getWindow()
f325b2
+void SwXTextDocument::setClipboard(const uno::Reference<datatransfer::clipboard::XClipboard>& xClipboard)
f325b2
 {
f325b2
     SolarMutexGuard aGuard;
f325b2
 
f325b2
-    return &pDocShell->GetView()->GetEditWin();
f325b2
+    pDocShell->GetView()->GetEditWin().SetClipboard(xClipboard);
f325b2
 }
f325b2
 
f325b2
 bool SwXTextDocument::isMimeTypeSupported()
f325b2
-- 
f325b2
2.12.0
f325b2