summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMert Tumer <mert.tumer@collabora.com>2020-04-29 16:29:57 +0300
committerMert Tumer <mert.tumer@collabora.com>2020-08-04 12:43:29 +0200
commit87c58f6a9351f2a2ec40fd99c4e5a63bfe29d0b8 (patch)
tree7d469da51f3de2a89b39ac840a57e4b1441a31ce /desktop
parent34decd703e880a04634585e20651a2f9b7fef393 (diff)
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@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97062 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98247 Tested-by: Jenkins Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx19
1 files changed, 16 insertions, 3 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")