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

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