summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMert Tumer <mert.tumer@collabora.com>2020-06-10 14:41:41 +0300
committerJan Holesovsky <kendy@collabora.com>2020-06-26 11:30:51 +0200
commit2f283b44c708f3b30cef25ebd8e04a5b4c48c626 (patch)
tree798d121ed0ea30474c65df58e18bcde461328d3d /desktop
parent3e8917702642595526a43f3d6866ba9b0446e50b (diff)
Fix .uno:SidebarHide command works for online
Change-Id: I03743d15300687b1da947d3c44be6a42aab83107 Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96618 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97059
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 69e8073b0bd0..51a8c80ad049 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -910,6 +910,16 @@ void setupSidebar(bool bShow, OUString sidebarDeckId = "")
SetLastExceptionMsg("No view shell or sidebar");
}
+void hideSidebar()
+{
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ SfxViewFrame* pViewFrame = pViewShell? pViewShell->GetViewFrame(): nullptr;
+ if (pViewFrame)
+ pViewFrame->SetChildWindow(SID_SIDEBAR, false, false);
+ else
+ SetLastExceptionMsg("No view shell or sidebar");
+}
+
VclPtr<Window> getSidebarWindow()
{
VclPtr<Window> xRet;
@@ -3957,7 +3967,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
}
else if (gImpl && aCommand == ".uno:SidebarHide")
{
- setupSidebar(false);
+ hideSidebar();
return;
}