include/sfx2/lokhelper.hxx     |    3 +--
 sfx2/source/view/lokhelper.cxx |   11 +++--------
 2 files changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 03480cafb73b725c536973cc960771eadacfe70d
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Jul 23 20:03:33 2025 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Jul 29 14:32:19 2025 +0200

    drop getView variant that auto-guesses from current viewshell
    
    all except one remaining case have a SfxViewShell arg known not
    to be null. Expand out that case explicitly.
    
    Change-Id: I9b3bfdd4fd9c2de50f933a05dd4e6ff48b64ed88
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188331
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 7144ad8a29e3..34cdb20ddab0 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -105,9 +105,8 @@ public:
     static SfxViewShell* getViewOfId(int nId);
     /// Get view id of view shell
     static int getView(const SfxViewShell& rViewShell);
-    /// Get the currently active view.
+    /// Get the currently active view shell id
     static int getCurrentView();
-    static int getView(const SfxViewShell* pViewShell = nullptr);
     /// Get the number of views of the current DocId.
     static std::size_t getViewsCount(int nDocId);
     /// Get viewIds of views of the current DocId.
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 0c58b0778439..7a5425b817db 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -259,13 +259,6 @@ int SfxLokHelper::getCurrentView()
     return SfxLokHelper::getView(*pViewShell);
 }
 
-int SfxLokHelper::getView(const SfxViewShell* pViewShell)
-{
-    if (pViewShell)
-        return SfxLokHelper::getView(*pViewShell);
-    return SfxLokHelper::getCurrentView();
-}
-
 std::size_t SfxLokHelper::getViewsCount(int nDocId)
 {
     assert(nDocId != -1 && "Cannot getViewsCount for invalid DocId -1");
@@ -1112,7 +1105,9 @@ void SfxLokHelper::notifyUpdatePerViewId(SfxViewShell 
const& rTargetShell, SfxVi
     if (DisableCallbacks::disabled())
         return;
 
-    int viewId = SfxLokHelper::getView(pViewShell);
+    // This getCurrentView() is dubious
+    SAL_WARN_IF(!pViewShell, "lok", "no explicit viewshell set");
+    int viewId = pViewShell ? SfxLokHelper::getView(*pViewShell) : 
SfxLokHelper::getCurrentView();
     int sourceViewId = SfxLokHelper::getView(rSourceShell);
     rTargetShell.libreOfficeKitViewUpdatedCallbackPerViewId(nType, viewId, 
sourceViewId);
 }

Reply via email to