include/LibreOfficeKit/LibreOfficeKitEnums.h |    9 +--------
 libreofficekit/source/gtk/lokdocview.cxx     |    1 -
 sd/source/ui/view/drviews1.cxx               |    3 ++-
 3 files changed, 3 insertions(+), 10 deletions(-)

New commits:
commit ffa17012ef1757a964908b5cdc069d9125e98d43
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 12:03:37 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>

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index df004aa0610e..8f2a2190cc73 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -405,6 +405,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)
     {
         /******************************************************************
@@ -451,9 +455,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 },
 
commit 2c2d84fefc5b3cc35c1db0d8244902362dc0531c
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Mon Jun 24 16:17:54 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Tue Jun 25 12:03:32 2024 +0200

    Revert "LOK: Introduce LOK_CALLBACK_STATUS_UPDATE"
    
    This reverts commit bbd32b39eae24e99d135ed5c48586db8c9b0fb23.
    A following commit will implement an alternative method without a
    new enum member.
    
    Change-Id: Id00a4a0abe68fc69b1a3a81c731c8085e3dbca2d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169467
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index dff64a584fdc..516622722bb9 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -1067,12 +1067,7 @@ typedef enum
      *
      * Here all aproperties are same as described in svxruler.
      */
-    LOK_CALLBACK_VERTICAL_RULER_UPDATE = 73,
-
-    /**
-    * Status of the document has changed notification
-    */
-    LOK_CALLBACK_STATUS_UPDATE = 74,
+    LOK_CALLBACK_VERTICAL_RULER_UPDATE = 73
 
 }
 LibreOfficeKitCallbackType;
@@ -1250,8 +1245,6 @@ 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 3eddb009c242..5dddaa2d0e37 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1502,7 +1502,6 @@ 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 00560836cb7f..df004aa0610e 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -405,9 +405,6 @@ 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)
     {
         /******************************************************************
@@ -454,6 +451,9 @@ 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 622dd2cad93c..f594fb1f7fcf 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1036,6 +1036,10 @@ 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();
 
@@ -1070,6 +1074,11 @@ 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 2cc5bbb422b3..a64f297aaf0c 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1151,7 +1151,6 @@ 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