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

Mert Tumer (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 26 09:30:39 UTC 2020


 desktop/source/lib/init.cxx                   |   19 ++++++++++++++++---
 include/sfx2/sidebar/SidebarDockingWindow.hxx |    1 +
 sfx2/source/sidebar/ResourceManager.cxx       |    9 +++++++++
 3 files changed, 26 insertions(+), 3 deletions(-)

New commits:
commit e80c47b42dd1c9ae869d241c327def8b4a0b1ad4
Author:     Mert Tumer <mert.tumer at collabora.com>
AuthorDate: Wed Apr 29 16:29:57 2020 +0300
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Jun 26 11:30:04 2020 +0200

    added ability to switch sidebar deck on init.cxx for mobilewizard
    
    Change-Id: I532398bc41e1c984c24b1d39e4844315a0a69847
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93162
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97062
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0434818c7845..2190c7d49e6a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -112,6 +112,7 @@
 #include <sfx2/DocumentSigner.hxx>
 #include <sfx2/sidebar/SidebarChildWindow.hxx>
 #include <sfx2/sidebar/SidebarDockingWindow.hxx>
+#include <sfx2/sidebar/SidebarController.hxx>
 #include <svx/dialmgr.hxx>
 #include <svx/dialogs.hrc>
 #include <svx/strings.hrc>
@@ -862,10 +863,10 @@ void ExecuteOrientationChange()
         mxUndoManager->leaveUndoContext();
 }
 
-void setupSidebar(bool bShow)
+void setupSidebar(bool bShow, OUString sidebarDeckId = "")
 {
     SfxViewShell* pViewShell = SfxViewShell::Current();
-    SfxViewFrame* pViewFrame = pViewShell? pViewShell->GetViewFrame(): nullptr;
+    SfxViewFrame* pViewFrame = pViewShell ? pViewShell->GetViewFrame() : nullptr;
     if (pViewFrame)
     {
         if (bShow && !pViewFrame->GetChildWindow(SID_SIDEBAR))
@@ -884,6 +885,11 @@ void setupSidebar(bool bShow)
         auto pDockingWin = dynamic_cast<sfx2::sidebar::SidebarDockingWindow *>(pChild->GetWindow());
         if (!pDockingWin)
             return;
+
+        if (!sidebarDeckId.isEmpty())
+        {
+            pDockingWin->GetSidebarController()->SwitchToDeck(sidebarDeckId);
+        }
         pDockingWin->SyncUpdate();
     }
     else
@@ -3795,6 +3801,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
     SfxObjectShell* pDocSh = SfxObjectShell::Current();
     OUString aCommand(pCommand, strlen(pCommand), RTL_TEXTENCODING_UTF8);
     LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
+    OUString sidebarDeckId = "PropertyDeck";
 
     std::vector<beans::PropertyValue> aPropertyValuesVector(jsonToPropertyValuesVector(pArguments));
 
@@ -3925,9 +3932,15 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
             return;
         }
     }
+    else if (gImpl && aCommand == ".uno:LOKSidebarWriterPage")
+    {
+        sidebarDeckId = "WriterPageDeck";
+        setupSidebar(true, sidebarDeckId);
+        return;
+    }
     else if (gImpl && aCommand == ".uno:SidebarShow")
     {
-        setupSidebar(true);
+        setupSidebar(true, sidebarDeckId);
         return;
     }
     else if (gImpl && aCommand == ".uno:SidebarHide")
diff --git a/include/sfx2/sidebar/SidebarDockingWindow.hxx b/include/sfx2/sidebar/SidebarDockingWindow.hxx
index 37f6532c7dd7..48afc8f19751 100644
--- a/include/sfx2/sidebar/SidebarDockingWindow.hxx
+++ b/include/sfx2/sidebar/SidebarDockingWindow.hxx
@@ -45,6 +45,7 @@ public:
 
     void SetReadyToDrag( bool bStartDrag ) { mbIsReadyToDrag = bStartDrag; }
     bool IsReadyToDrag() const { return mbIsReadyToDrag; }
+    auto& GetSidebarController() const { return mpSidebarController; }
 
     /// Force generation of all panels by completion.
     void SyncUpdate();
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index e1e011422da7..9cd9543eb2f0 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -429,6 +429,15 @@ void ResourceManager::ReadPanelList()
         if (!aPanelNode.isValid())
             continue;
 
+        if (comphelper::LibreOfficeKit::isActive())
+        {
+            // Hide these panels in LOK as they aren't fully functional.
+            OUString aPanelId = getString(aPanelNode, "Id");
+            if (aPanelId == "PageStylesPanel" || aPanelId == "PageHeaderPanel"
+                || aPanelId == "PageFooterPanel")
+                continue;
+        }
+
         maPanels.push_back(std::make_shared<PanelDescriptor>());
         PanelDescriptor& rPanelDescriptor(*maPanels.back());
 


More information about the Libreoffice-commits mailing list