sd/source/ui/view/drviews2.cxx          |   29 ++++++++++++++++++++---------
 sfx2/source/sidebar/ResourceManager.cxx |    3 +--
 sfx2/source/view/viewfrm.cxx            |   11 +++++++++++
 vcl/jsdialog/enabled.cxx                |    6 +++---
 vcl/jsdialog/jsdialogbuilder.cxx        |    9 ++++++---
 5 files changed, 41 insertions(+), 17 deletions(-)

New commits:
commit 6b734f99a1ca9165b86f6588a720de6dc90d3f7b
Author:     Attila Szűcs <attila.sz...@collabora.com>
AuthorDate: Wed May 3 04:24:35 2023 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Fri May 5 12:14:04 2023 +0200

    LOK: Navi-1 open/close on sidebar
    
    Enabling Navigator sidebar in case of LOKit.
    
    Change-Id: I3a656fa12822e5866c2cd4fbf82627a88f26903a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151307
    Tested-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 94207a01653e..d5bcbec91eaa 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -3350,16 +3350,27 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
         case SID_NAVIGATOR:
         {
-            if ( rReq.GetArgs() )
-                GetViewFrame()->SetChildWindow(SID_NAVIGATOR,
-                                        static_cast<const 
SfxBoolItem&>(rReq.GetArgs()->
-                                        Get(SID_NAVIGATOR)).GetValue());
-            else
-                GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR );
+            if (comphelper::LibreOfficeKit::isActive())
+            {
+                GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
+                OUString panelId = "SdNavigatorPanel";
+                ::sfx2::sidebar::Sidebar::TogglePanel(
+                    panelId, GetViewFrame()->GetFrame().GetFrameInterface());
 
-            GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR);
-            Cancel();
-            rReq.Ignore ();
+                Cancel();
+                rReq.Done();
+            } else {
+                if ( rReq.GetArgs() )
+                    GetViewFrame()->SetChildWindow(SID_NAVIGATOR,
+                                            static_cast<const 
SfxBoolItem&>(rReq.GetArgs()->
+                                            Get(SID_NAVIGATOR)).GetValue());
+                else
+                    GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR );
+
+                GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR);
+                Cancel();
+                rReq.Ignore ();
+            }
         }
         break;
 
diff --git a/sfx2/source/sidebar/ResourceManager.cxx 
b/sfx2/source/sidebar/ResourceManager.cxx
index cfc5437037cc..5974e20af488 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -260,8 +260,7 @@ void ResourceManager::ReadDeckList()
         if (comphelper::LibreOfficeKit::isActive())
         {
             // Hide these decks in LOK as they aren't fully functional.
-            if (aDeckName == "GalleryDeck" || aDeckName == "NavigatorDeck"
-                || aDeckName == "StyleListDeck")
+            if (aDeckName == "GalleryDeck" || aDeckName == "StyleListDeck")
                 continue;
         }
 
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 6ac5653db267..e082d651073e 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -3335,6 +3335,17 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq )
         rReq.Done();
         return;
     }
+    if (nSID == SID_NAVIGATOR)
+    {
+        if (comphelper::LibreOfficeKit::isActive())
+        {
+            ShowChildWindow(SID_SIDEBAR);
+            OUString panelId = "SdNavigatorPanel";
+            ::sfx2::sidebar::Sidebar::TogglePanel(panelId, 
GetFrame().GetFrameInterface());
+            rReq.Done();
+            return;
+        }
+    }
 
     bool bHasChild = HasChildWindow(nSID);
     bool bShow = pShowItem ? pShowItem->GetValue() : !bHasChild;
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 0fd8f6e94293..807f1d14a580 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -292,7 +292,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile)
 {
     if (// scalc
         rUIFile == u"modules/scalc/ui/functionpanel.ui"
-        //|| rUIFile == u"modules/scalc/ui/navigatorpanel.ui"
+        || rUIFile == u"modules/scalc/ui/navigatorpanel.ui"
         || rUIFile == u"modules/scalc/ui/sidebaralignment.ui"
         || rUIFile == u"modules/scalc/ui/sidebarcellappearance.ui"
         || rUIFile == u"modules/scalc/ui/sidebarnumberformat.ui"
@@ -309,7 +309,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile)
         || rUIFile == u"modules/simpress/ui/masterpagepanel.ui"
         || rUIFile == u"modules/simpress/ui/masterpagepanelall.ui"
         || rUIFile == u"modules/simpress/ui/masterpagepanelrecent.ui"
-        //|| rUIFile == u"modules/simpress/ui/navigatorpanel.ui"
+        || rUIFile == u"modules/simpress/ui/navigatorpanel.ui"
         || rUIFile == u"modules/simpress/ui/sidebarslidebackground.ui"
         || rUIFile == u"modules/simpress/ui/slidetransitionspanel.ui"
         || rUIFile == u"modules/simpress/ui/tabledesignpanel.ui"
@@ -318,7 +318,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile)
         || rUIFile == u"modules/smath/ui/sidebarproperties_math.ui"
         // swriter
         || rUIFile == u"modules/swriter/ui/managechangessidebar.ui"
-        //|| rUIFile == u"modules/swriter/ui/navigatorpanel.ui"
+        || rUIFile == u"modules/swriter/ui/navigatorpanel.ui"
         || rUIFile == u"modules/swriter/ui/pagefooterpanel.ui"
         || rUIFile == u"modules/swriter/ui/pageformatpanel.ui"
         || rUIFile == u"modules/swriter/ui/pageheaderpanel.ui"
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 3f094891c6eb..caba64a60c32 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -143,7 +143,8 @@ std::unique_ptr<tools::JsonWriter> 
JSDialogNotifyIdle::generateFullUpdate() cons
         return aJsonWriter;
 
     m_aContentWindow->DumpAsPropertyTree(*aJsonWriter);
-    aJsonWriter->put("id", m_aNotifierWindow->GetLOKWindowId());
+    if (m_aNotifierWindow)
+        aJsonWriter->put("id", m_aNotifierWindow->GetLOKWindowId());
     aJsonWriter->put("jsontype", m_sTypeOfJSON);
 
     return aJsonWriter;
@@ -159,7 +160,8 @@ 
JSDialogNotifyIdle::generateWidgetUpdate(VclPtr<vcl::Window> pWindow) const
 
     aJsonWriter->put("jsontype", m_sTypeOfJSON);
     aJsonWriter->put("action", "update");
-    aJsonWriter->put("id", m_aNotifierWindow->GetLOKWindowId());
+    if (m_aNotifierWindow)
+        aJsonWriter->put("id", m_aNotifierWindow->GetLOKWindowId());
     {
         auto aEntries = aJsonWriter->startNode("control");
         pWindow->DumpAsPropertyTree(*aJsonWriter);
@@ -187,7 +189,8 @@ 
JSDialogNotifyIdle::generateActionMessage(VclPtr<vcl::Window> pWindow,
 
     aJsonWriter->put("jsontype", m_sTypeOfJSON);
     aJsonWriter->put("action", "action");
-    aJsonWriter->put("id", m_aNotifierWindow->GetLOKWindowId());
+    if (m_aNotifierWindow)
+        aJsonWriter->put("id", m_aNotifierWindow->GetLOKWindowId());
 
     {
         auto aDataNode = aJsonWriter->startNode("data");

Reply via email to