diff options
Diffstat (limited to 'desktop/source/lib/init.cxx')
-rw-r--r-- | desktop/source/lib/init.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 7c3a86ca5878..e6c2d6630a58 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -113,6 +113,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> @@ -1120,7 +1121,7 @@ rtl::Reference<LOKClipboard> forceSetClipboardForCurrentView(LibreOfficeKitDocum #endif -void setupSidebar(bool bShow) +void setupSidebar(bool bShow, OUString sidebarDeckId = "") { SfxViewShell* pViewShell = SfxViewShell::Current(); SfxViewFrame* pViewFrame = pViewShell ? pViewShell->GetViewFrame() : nullptr; @@ -1142,6 +1143,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 @@ -3625,6 +3631,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)); @@ -3756,9 +3763,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") |