diff options
-rw-r--r-- | desktop/source/lib/init.cxx | 19 | ||||
-rw-r--r-- | include/sfx2/sidebar/SidebarDockingWindow.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.cxx | 9 |
3 files changed, 26 insertions, 4 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index dc1b6b1664fc..346c5174accd 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -111,6 +111,7 @@ #include <sfx2/lokcharthelper.hxx> #include <sfx2/DocumentSigner.hxx> #include <sfx2/sidebar/SidebarDockingWindow.hxx> +#include <sfx2/sidebar/SidebarController.hxx> #include <svx/dialmgr.hxx> #include <svx/strings.hrc> #include <svx/svdview.hxx> @@ -883,10 +884,10 @@ void ExecuteOrientationChange() mxUndoManager->leaveUndoContext(); } -void setupSidebar(bool bShow) +void setupSidebar(bool bShow, const 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)) @@ -905,6 +906,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 @@ -3744,6 +3750,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)); @@ -3897,9 +3904,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 6d726ddd1260..f156ab0cb0fb 100644 --- a/include/sfx2/sidebar/SidebarDockingWindow.hxx +++ b/include/sfx2/sidebar/SidebarDockingWindow.hxx @@ -49,7 +49,7 @@ public: void SyncUpdate(); void NotifyResize(); - + auto& GetSidebarController() const { return mpSidebarController; } using SfxDockingWindow::Close; private: diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index f3440e6dcb46..c61781643f49 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()); |