[Libreoffice-commits] core.git: include/sfx2 sd/source sfx2/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 6 07:56:40 UTC 2019


 include/sfx2/viewsh.hxx                          |    3 +--
 sd/source/ui/framework/tools/FrameworkHelper.cxx |    8 ++++----
 sd/source/ui/inc/framework/FrameworkHelper.hxx   |    6 +++---
 sfx2/source/view/viewsh.cxx                      |    2 +-
 4 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 7665246ac8addc002f74e3a9b22d1baeda448af3
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sat Aug 4 23:38:44 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Jun 6 09:55:27 2019 +0200

    ViewShellBase const correctness
    
    Change-Id: I00bffe23f2f850f5e0cbf63a60aa1600f848edac
    (cherry picked from commit 4e6e33870a60a796c17c1e2d67ac6482b853ad28)
    Reviewed-on: https://gerrit.libreoffice.org/73479
    Tested-by: Jenkins
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index e0240ae952b4..cc76aefd6a5c 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -274,8 +274,7 @@ public:
     void                        SetNewWindowAllowed( bool bSet )    { bNoNewWindow = !bSet; }
 
     void                        SetController( SfxBaseController* pController );
-    css::uno::Reference< css::frame::XController >
-                                GetController();
+    css::uno::Reference<css::frame::XController> GetController() const;
 
     bool                        TryContextMenuInterception( Menu& rIn, const OUString& rMenuIdentifier, VclPtr<Menu>& rpOut, css::ui::ContextMenuExecuteEvent aEvent );
     bool                        TryContextMenuInterception( Menu& rMenu, const OUString& rMenuIdentifier, css::ui::ContextMenuExecuteEvent aEvent );
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 5878aab82ffe..1ab5f4552500 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -84,7 +84,7 @@ public:
             callback is destroyed.
     */
     CallbackCaller (
-        ::sd::ViewShellBase& rBase,
+        const ::sd::ViewShellBase& rBase,
         const OUString& rsEventType,
         const ::sd::framework::FrameworkHelper::ConfigurationChangeEventFilter& rFilter,
         const ::sd::framework::FrameworkHelper::Callback& rCallback);
@@ -343,7 +343,7 @@ FrameworkHelper::InstanceMap FrameworkHelper::maInstanceMap;
     return pHelper;
 }
 
-void FrameworkHelper::DisposeInstance (ViewShellBase& rBase)
+void FrameworkHelper::DisposeInstance (const ViewShellBase& rBase)
 {
     InstanceMap::iterator iHelper (maInstanceMap.find(&rBase));
     if (iHelper != maInstanceMap.end())
@@ -352,7 +352,7 @@ void FrameworkHelper::DisposeInstance (ViewShellBase& rBase)
     }
 }
 
-void FrameworkHelper::ReleaseInstance (ViewShellBase& rBase)
+void FrameworkHelper::ReleaseInstance (const ViewShellBase& rBase)
 {
     InstanceMap::iterator iHelper (maInstanceMap.find(&rBase));
     if (iHelper != maInstanceMap.end())
@@ -830,7 +830,7 @@ namespace {
 //===== CallbackCaller ========================================================
 
 CallbackCaller::CallbackCaller (
-    ::sd::ViewShellBase& rBase,
+    const ::sd::ViewShellBase& rBase,
     const OUString& rsEventType,
     const ::sd::framework::FrameworkHelper::ConfigurationChangeEventFilter& rFilter,
     const ::sd::framework::FrameworkHelper::Callback& rCallback)
diff --git a/sd/source/ui/inc/framework/FrameworkHelper.hxx b/sd/source/ui/inc/framework/FrameworkHelper.hxx
index f4e44fab22db..20d7d0c9149a 100644
--- a/sd/source/ui/inc/framework/FrameworkHelper.hxx
+++ b/sd/source/ui/inc/framework/FrameworkHelper.hxx
@@ -114,14 +114,14 @@ public:
         Do not call this method.  It is an internally used method that can
         not be made private.
     */
-    static void DisposeInstance (ViewShellBase& rBase);
+    static void DisposeInstance (const ViewShellBase& rBase);
 
     /** Destroy the FrameworkHelper object for the given ViewShellBase.
 
         Do not call this method.  It is an internally used method that can
         not be made private.
     */
-    static void ReleaseInstance (ViewShellBase& rBase);
+    static void ReleaseInstance (const ViewShellBase& rBase);
 
     /** Return an identifier for the given view URL.  This identifier can be
         used in a switch statement.  See GetViewURL() for a mapping in the
@@ -299,7 +299,7 @@ public:
 
 private:
     typedef ::std::map<
-        ViewShellBase*,
+        const ViewShellBase*,
         ::std::shared_ptr<FrameworkHelper> > InstanceMap;
     /** The instance map holds (at least) one FrameworkHelper instance for
         every ViewShellBase object.
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index fbd3a2bd29aa..eeafd198cb5e 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1759,7 +1759,7 @@ void SfxViewShell::SetController( SfxBaseController* pController )
     pImpl->xClipboardListener = new SfxClipboardChangeListener( this, GetClipboardNotifier() );
 }
 
-Reference < XController > SfxViewShell::GetController()
+Reference < XController > SfxViewShell::GetController() const
 {
     return pImpl->m_pController.get();
 }


More information about the Libreoffice-commits mailing list