f325b2
From b2d1dd0d6c4368909b90733aed41d5dc26113c00 Mon Sep 17 00:00:00 2001
f325b2
From: Miklos Vajna <vmiklos@collabora.co.uk>
f325b2
Date: Wed, 16 Sep 2015 10:32:34 +0200
f325b2
Subject: [PATCH 140/398] Use SfxViewFrame::Current()
f325b2
f325b2
Allows getting rid of vcl::ITiledRenderable::getCurrentViewShell(),
f325b2
which would do the same, just not implemented outside Writer.
f325b2
f325b2
Change-Id: Id26ceca560fb9002dc2d5c740c411b9c4a149523
f325b2
(cherry picked from commit 8cb6094447041b7fbe29bd5584b5daf9babb5cad)
f325b2
---
f325b2
 desktop/source/lib/init.cxx       | 12 ++----------
f325b2
 include/sfx2/lokhelper.hxx        |  4 ++--
f325b2
 include/vcl/ITiledRenderable.hxx  |  8 --------
f325b2
 sfx2/source/view/lokhelper.cxx    |  4 ++--
f325b2
 sw/inc/unotxdoc.hxx               |  2 --
f325b2
 sw/source/uibase/uno/unotxdoc.cxx |  5 -----
f325b2
 6 files changed, 6 insertions(+), 29 deletions(-)
f325b2
f325b2
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
f325b2
index d76de5e5bb3c..fa99038860cd 100644
f325b2
--- a/desktop/source/lib/init.cxx
f325b2
+++ b/desktop/source/lib/init.cxx
f325b2
@@ -1049,19 +1049,11 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
f325b2
     }
f325b2
 }
f325b2
 
f325b2
-static int doc_createView(LibreOfficeKitDocument* pThis)
f325b2
+static int doc_createView(LibreOfficeKitDocument* /*pThis*/)
f325b2
 {
f325b2
     SolarMutexGuard aGuard;
f325b2
 
f325b2
-    ITiledRenderable* pDoc = getTiledRenderable(pThis);
f325b2
-    if (!pDoc)
f325b2
-    {
f325b2
-        gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
f325b2
-        return -1;
f325b2
-    }
f325b2
-
f325b2
-    SfxViewShell* pViewShell = pDoc->getCurrentViewShell();
f325b2
-    return SfxLokHelper::createView(pViewShell);
f325b2
+    return SfxLokHelper::createView();
f325b2
 }
f325b2
 
f325b2
 static void doc_destroyView(LibreOfficeKitDocument* /*pThis*/, int nId)
f325b2
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
f325b2
index a05cd5d4b210..50516227e992 100644
f325b2
--- a/include/sfx2/lokhelper.hxx
f325b2
+++ b/include/sfx2/lokhelper.hxx
f325b2
@@ -17,8 +17,8 @@ class SfxViewShell;
f325b2
 class SFX2_DLLPUBLIC SfxLokHelper
f325b2
 {
f325b2
 public:
f325b2
-    /// Create a new view shell for pViewShell's object shell.
f325b2
-    static int createView(SfxViewShell* pViewShell);
f325b2
+    /// Create a new view shell from the current view frame.
f325b2
+    static int createView();
f325b2
     /// Destroy a view shell from the global shell list.
f325b2
     static void destroyView(size_t nId);
f325b2
     /// Set a view shell as current one.
f325b2
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
f325b2
index a31d808437af..6639745e4a2f 100644
f325b2
--- a/include/vcl/ITiledRenderable.hxx
f325b2
+++ b/include/vcl/ITiledRenderable.hxx
f325b2
@@ -16,8 +16,6 @@
f325b2
 #include <tools/gen.hxx>
f325b2
 #include <vcl/virdev.hxx>
f325b2
 
f325b2
-class SfxViewShell;
f325b2
-
f325b2
 namespace vcl
f325b2
 {
f325b2
 
f325b2
@@ -141,12 +139,6 @@ public:
f325b2
      * @see lok::Document::resetSelection().
f325b2
      */
f325b2
     virtual void resetSelection() = 0;
f325b2
-
f325b2
-    /// Get the currently active view shell of the document.
f325b2
-    virtual SfxViewShell* getCurrentViewShell()
f325b2
-    {
f325b2
-        return 0;
f325b2
-    }
f325b2
 };
f325b2
 
f325b2
 } // namespace vcl
f325b2
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
f325b2
index 0aea6db9c24e..f53d2b35b1bd 100644
f325b2
--- a/sfx2/source/view/lokhelper.cxx
f325b2
+++ b/sfx2/source/view/lokhelper.cxx
f325b2
@@ -15,9 +15,9 @@
f325b2
 
f325b2
 #include <shellimpl.hxx>
f325b2
 
f325b2
-int SfxLokHelper::createView(SfxViewShell* pViewShell)
f325b2
+int SfxLokHelper::createView()
f325b2
 {
f325b2
-    SfxViewFrame* pViewFrame = pViewShell->GetViewFrame();
f325b2
+    SfxViewFrame* pViewFrame = SfxViewFrame::Current();
f325b2
     SfxRequest aRequest(pViewFrame, SID_NEWWINDOW);
f325b2
     pViewFrame->ExecView_Impl(aRequest);
f325b2
 
f325b2
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
f325b2
index 71dbb4f2fd5a..9f0b03b3af38 100644
f325b2
--- a/sw/inc/unotxdoc.hxx
f325b2
+++ b/sw/inc/unotxdoc.hxx
f325b2
@@ -431,8 +431,6 @@ public:
f325b2
     virtual void setGraphicSelection(int nType, int nX, int nY) SAL_OVERRIDE;
f325b2
     /// @see vcl::ITiledRenderable::resetSelection().
f325b2
     virtual void resetSelection() SAL_OVERRIDE;
f325b2
-    /// @see vcl::ITiledRenderable::getCurrentViewShell().
f325b2
-    virtual SfxViewShell* getCurrentViewShell() SAL_OVERRIDE;
f325b2
 
f325b2
     // ::com::sun::star::tiledrendering::XTiledRenderable
f325b2
     virtual void SAL_CALL paintTile( const ::css::uno::Any& Parent, ::sal_Int32 nOutputWidth, ::sal_Int32 nOutputHeight, ::sal_Int32 nTilePosX, ::sal_Int32 nTilePosY, ::sal_Int32 nTileWidth, ::sal_Int32 nTileHeight ) throw (::css::uno::RuntimeException, ::std::exception) SAL_OVERRIDE;
f325b2
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
f325b2
index 8dce9b5589d6..d6315d2964ae 100644
f325b2
--- a/sw/source/uibase/uno/unotxdoc.cxx
f325b2
+++ b/sw/source/uibase/uno/unotxdoc.cxx
f325b2
@@ -3410,11 +3410,6 @@ void SwXTextDocument::resetSelection()
f325b2
     pWrtShell->ResetSelect(0, false);
f325b2
 }
f325b2
 
f325b2
-SfxViewShell* SwXTextDocument::getCurrentViewShell()
f325b2
-{
f325b2
-    return pDocShell->GetView();
f325b2
-}
f325b2
-
f325b2
 void SAL_CALL SwXTextDocument::paintTile( const ::css::uno::Any& Parent, ::sal_Int32 nOutputWidth, ::sal_Int32 nOutputHeight, ::sal_Int32 nTilePosX, ::sal_Int32 nTilePosY, ::sal_Int32 nTileWidth, ::sal_Int32 nTileHeight ) throw (::css::uno::RuntimeException, ::std::exception)
f325b2
 {
f325b2
     SystemGraphicsData aData;
f325b2
-- 
f325b2
2.12.0
f325b2