include/LibreOfficeKit/LibreOfficeKitEnums.h |    9 ++++++++-
 libreofficekit/source/gtk/lokdocview.cxx     |    1 +
 sd/source/ui/view/drviews1.cxx               |    6 +++---
 sd/source/ui/view/drviewse.cxx               |    9 ---------
 sfx2/source/control/unoctitm.cxx             |    1 +
 5 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit bbd32b39eae24e99d135ed5c48586db8c9b0fb23
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Thu Jun 20 13:06:47 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Fri Jun 21 15:46:17 2024 +0200

    LOK: Introduce LOK_CALLBACK_STATUS_UPDATE
    
    This allows to send status messages separately from statechanged;
    this is needed in Impress to notify about any mode update, not only
    masterview-related.
    
    Also send SlideMasterPage updates automatically from core.
    
    Change-Id: I0a50dbe61a5f2f28cd418eb4416819a6a76810b0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169314
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 516622722bb9..dff64a584fdc 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -1067,7 +1067,12 @@ typedef enum
      *
      * Here all aproperties are same as described in svxruler.
      */
-    LOK_CALLBACK_VERTICAL_RULER_UPDATE = 73
+    LOK_CALLBACK_VERTICAL_RULER_UPDATE = 73,
+
+    /**
+    * Status of the document has changed notification
+    */
+    LOK_CALLBACK_STATUS_UPDATE = 74,
 
 }
 LibreOfficeKitCallbackType;
@@ -1245,6 +1250,8 @@ static inline const char* lokCallbackTypeToString(int 
nType)
         return "LOK_CALLBACK_TOOLTIP";
     case LOK_CALLBACK_SHAPE_INNER_TEXT:
         return "LOK_CALLBACK_SHAPE_INNER_TEXT";
+    case LOK_CALLBACK_STATUS_UPDATE:
+        return "LOK_CALLBACK_STATUS_UPDATE";
     }
 
     assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 5dddaa2d0e37..3eddb009c242 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1502,6 +1502,7 @@ callback (gpointer pData)
     case LOK_CALLBACK_CORE_LOG:
     case LOK_CALLBACK_TOOLTIP:
     case LOK_CALLBACK_SHAPE_INNER_TEXT:
+    case LOK_CALLBACK_STATUS_UPDATE:
     {
         // TODO: Implement me
         break;
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index df004aa0610e..00560836cb7f 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -405,6 +405,9 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool 
bIsLayerModeActive)
                 pTitledDockingWindow->SetTitle(SdResId(aId));
     };
 
+    if (comphelper::LibreOfficeKit::isActive())
+        GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATUS_UPDATE, 
{});
+
     if (meEditMode == EditMode::Page)
     {
         /******************************************************************
@@ -451,9 +454,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 f594fb1f7fcf..622dd2cad93c 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1036,10 +1036,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();
 
@@ -1074,11 +1070,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 a64f297aaf0c..2cc5bbb422b3 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