[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/sfx2 include/svx sfx2/sdi sfx2/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 16 09:26:14 UTC 2019


 desktop/source/lib/init.cxx                  |   12 ++++-----
 include/sfx2/sfxsids.hrc                     |    2 +
 include/svx/svxids.hrc                       |    5 +++
 sfx2/sdi/frmslots.sdi                        |   10 +++++++
 sfx2/sdi/sfx.sdi                             |   36 +++++++++++++++++++++++++++
 sfx2/source/sidebar/SidebarController.cxx    |    2 -
 sfx2/source/sidebar/SidebarDockingWindow.cxx |    4 ++-
 sfx2/source/view/viewfrm.cxx                 |   19 +++++++++++---
 8 files changed, 77 insertions(+), 13 deletions(-)

New commits:
commit bc2181cfc7280716c48d8bd0a07db849a32a97aa
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Dec 15 21:12:17 2019 -0500
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Dec 16 10:25:35 2019 +0100

    sfx2: sidebar: new .uno commands to show and hide sidebars
    
    Change-Id: I9afba5eec855d6de590086736177b543d52d3b20
    Reviewed-on: https://gerrit.libreoffice.org/85192
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5597f5be9bb4..f97cd6707187 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3307,12 +3307,12 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
     }
     else if (aMap.find("id") != aMap.end())
     {
-        const OUString sClickAction("CLICK");
-        const OUString sSelectAction("SELECT");
-        const OUString sClearAction("CLEAR");
-        const OUString sTypeAction("TYPE");
-        const OUString sUpAction("UP");
-        const OUString sDownAction("DOWN");
+        static const OUString sClickAction("CLICK");
+        static const OUString sSelectAction("SELECT");
+        static const OUString sClearAction("CLEAR");
+        static const OUString sTypeAction("TYPE");
+        static const OUString sUpAction("UP");
+        static const OUString sDownAction("DOWN");
 
         try
         {
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 558a303fb573..b1200ecc2f57 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -565,6 +565,8 @@ class SfxDocumentInfoItem;
 #define SID_TABLE_BORDER_TYPE               (SID_SVX_START + 1065)
 #define SID_TABLE_BORDER_INDEX              (SID_SVX_START + 1066)
 #define SID_TABLE_BORDER_OFFSET             (SID_SVX_START + 1067)
+#define SID_SHOW_SIDEBAR                    (SID_SVX_START + 1190)
+#define SID_HIDE_SIDEBAR                    (SID_SVX_START + 1191)
 
 #define FID_SVX_START                       (SID_LIB_START + 500)
 #define FID_SEARCH_NOW                      (FID_SVX_START + 2)
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 2924a1bec218..d429b17f2af0 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -986,8 +986,11 @@ class SfxStringItem;
 
 #define SID_TOGGLE_RESOLVED_NOTES                       ( SID_SVX_START + 1189 )
 
+// #define SID_SHOW_SIDEBAR                                ( SID_SVX_START + 1190 ) -> sfxsids.hrc
+// #define SID_HIDE_SIDEBAR                                ( SID_SVX_START + 1191 ) -> sfxsids.hrc
+
 // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE                               ( SID_TOGGLE_RESOLVED_NOTES + 1 )
+#define SID_SVX_FIRSTFREE                               ( SID_HIDE_SIDEBAR + 1 )
 
 // Overflow check for slot IDs
 #if SID_SVX_FIRSTFREE > SID_SVX_END
diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi
index 09aafef95b7d..53a13b479a7c 100644
--- a/sfx2/sdi/frmslots.sdi
+++ b/sfx2/sdi/frmslots.sdi
@@ -43,6 +43,16 @@ interface Window
         ExecMethod = ChildWindowExecute ;
         StateMethod = ChildWindowState ;
     ]
+    SID_SHOW_SIDEBAR // status(final|play)
+    [
+        ExecMethod = ChildWindowExecute ;
+        StateMethod = ChildWindowState ;
+    ]
+    SID_HIDE_SIDEBAR // status(final|play)
+    [
+        ExecMethod = ChildWindowExecute ;
+        StateMethod = ChildWindowState ;
+    ]
     SID_BROWSER // ole(no) api()
     [
         ExecMethod = ChildWindowExecute ;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 2540782a7427..fcda39ddae2b 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -2577,6 +2577,42 @@ SfxBoolItem Sidebar SID_SIDEBAR
     GroupId = SfxGroupId::View;
 ]
 
+SfxBoolItem SidebarShow SID_SHOW_SIDEBAR
+[
+    AutoUpdate = TRUE,
+    FastCall = FALSE,
+    ReadOnlyDoc = TRUE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Asynchron;
+
+
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    ToolBoxConfig = TRUE,
+    GroupId = SfxGroupId::View;
+]
+
+SfxBoolItem SidebarHide SID_HIDE_SIDEBAR
+[
+    AutoUpdate = TRUE,
+    FastCall = FALSE,
+    ReadOnlyDoc = TRUE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Asynchron;
+
+
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    ToolBoxConfig = TRUE,
+    GroupId = SfxGroupId::View;
+]
+
 SfxBoolItem Menubar SID_MENUBAR
 [
     AutoUpdate = TRUE,
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 561bc1e18ce5..72d6d216c5a2 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1217,7 +1217,7 @@ void SidebarController::RequestCloseDeck()
             // Mobile.
             std::stringstream aStream;
             boost::property_tree::ptree aTree;
-            aTree.put("id", mpParentWindow->get_id()); // TODO could be missing - sort out
+            aTree.put("id", mpCurrentDeck->GetLOKWindowId());
             aTree.put("type", "dockingwindow");
             aTree.put("text", mpParentWindow->GetText());
             aTree.put("enabled", false);
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index cba9e50fb2b4..5facecb2deb3 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -66,7 +66,9 @@ public:
             {
                 // Mobile.
                 std::stringstream aStream;
-                boost::property_tree::write_json(aStream, m_rSidebarDockingWin.DumpAsPropertyTree());
+                boost::property_tree::ptree aTree = m_rSidebarDockingWin.DumpAsPropertyTree();
+                aTree.put("id", m_rSidebarDockingWin.GetLOKWindowId());
+                boost::property_tree::write_json(aStream, aTree);
                 const std::string message = aStream.str();
                 if (message != m_LastNotificationMessage)
                 {
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 25d8a5c4bf76..21a34eb85215 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -3089,17 +3089,28 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState )
             else if ( KnowsChildWindow(nSID) )
                 rState.Put( SfxBoolItem( nSID, HasChildWindow(nSID) ) );
         }
-        else if ( nSID == SID_SIDEBAR )
+        else if ( nSID == SID_SIDEBAR || nSID == SID_SHOW_SIDEBAR || nSID == SID_HIDE_SIDEBAR )
         {
-            if  ( !KnowsChildWindow( nSID ) )
+            if  ( !KnowsChildWindow( SID_SIDEBAR ) )
             {
                 SAL_WARN("sfx.view", "SID_SIDEBAR state requested, but no task pane child window exists for this ID!");
-                rState.DisableItem( nSID );
+                rState.DisableItem( SID_SIDEBAR );
             }
-            else
+            else if ( nSID == SID_SIDEBAR )
             {
+                // Toggle.
                 rState.Put( SfxBoolItem( nSID, HasChildWindow( nSID ) ) );
             }
+            else if ( nSID == SID_SHOW_SIDEBAR )
+            {
+                // Show.
+                rState.Put( SfxBoolItem( nSID, false ) );
+            }
+            else if ( nSID == SID_HIDE_SIDEBAR )
+            {
+                // Hide.
+                rState.Put( SfxBoolItem( nSID, true ) );
+            }
         }
         else if ( KnowsChildWindow(nSID) )
             rState.Put( SfxBoolItem( nSID, HasChildWindow(nSID) ) );


More information about the Libreoffice-commits mailing list