sd/source/ui/view/drviews1.cxx   |    7 ++++---
 sd/source/ui/view/drviewse.cxx   |    9 ---------
 sfx2/source/control/unoctitm.cxx |    1 +
 3 files changed, 5 insertions(+), 12 deletions(-)

New commits:
commit f9f4570e05b11cf80379684abe4453990ddec581
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Mon Jun 24 18:54:53 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Tue Jun 25 14:04:12 2024 +0200

    LOK: Do a ".uno:DocumentStatus" "state changed" callback
    
    ... along with proper state changed callbacks for .uno:SlideMasterPage,
    .uno:NormalMultiPaneGUI, .uno:NotesMode, and others.
    
    The ".uno:DocumentStatus" payload is a notification for the callback
    that it may need to collect the document status.
    
    This allows to avoid the bond between the mentioned true UNO command
    names, and the status collection: since we now send the status updates
    for all of them, the document status collection would be performed for
    each of them in the absence of a dedicated signal.
    
    This re-implements commit bbd32b39eae24e99d135ed5c48586db8c9b0fb23,
    without introducing a new callback enum value.
    
    Change-Id: I942e17298196ff39ef8817a4cd59ad0fb8fa0da1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169468
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Mike Kaganski <mike.kagan...@collabora.com>
    (cherry picked from commit ffa17012ef1757a964908b5cdc069d9125e98d43)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169497
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index a48ab7a11546..abc4321118b7 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -406,6 +406,10 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool 
bIsLayerModeActive)
                 pTitledDockingWindow->SetTitle(SdResId(aId));
     };
 
+    if (comphelper::LibreOfficeKit::isActive())
+        GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                                                   
".uno:DocumentStatus"_ostr); // pseudo-command
+
     if (meEditMode == EditMode::Page)
     {
         /******************************************************************
@@ -452,9 +456,6 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool 
bIsLayerModeActive)
         setLeftPaneTitleIfPaneExists(SID_LEFT_PANE_DRAW, 
STR_LEFT_PANE_DRAW_TITLE_MASTER);
         setLeftPaneTitleIfPaneExists(SID_LEFT_PANE_IMPRESS, 
STR_LEFT_PANE_IMPRESS_TITLE_MASTER);
 
-        if (comphelper::LibreOfficeKit::isActive())
-            
GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
-                                                       
".uno:SlideMasterPage=true"_ostr);
         if (!mpActualPage)
         {
             // as long as there is no mpActualPage, take first
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 9f72178c6387..90a80eb32a9c 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1033,10 +1033,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
 
         case SID_MASTERPAGE:          // BASIC
         {
-            if (comphelper::LibreOfficeKit::isActive())
-                
GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
-                                                           
".uno:SlideMasterPage=true"_ostr);
-
             // AutoLayouts needs to be finished
             GetDoc()->StopWorkStartupDelay();
 
@@ -1071,11 +1067,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
 
         case SID_CLOSE_MASTER_VIEW:
         {
-            // Notify of disabling master view, which is enabled in 
DrawViewShell::ChangeEditMode.
-            if (comphelper::LibreOfficeKit::isActive())
-                
GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
-                                                           
".uno:SlideMasterPage=false"_ostr);
-
             Broadcast (
                 ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START));
 
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index d1e0017cc1ba..2b5f80352c93 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1151,6 +1151,7 @@ constexpr auto handlers = 
frozen::make_unordered_map<std::u16string_view, Payloa
     { u"CellProtection", IsActivePayload },
     { u"NormalMultiPaneGUI", IsActivePayload },
     { u"NotesMode", IsActivePayload },
+    { u"SlideMasterPage", IsActivePayload },
 
     { u"CharFontName", FontNamePayload },
 

Reply via email to