desktop/source/lib/init.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 34decd703e880a04634585e20651a2f9b7fef393
Author:     Mert Tumer <mert.tu...@collabora.com>
AuthorDate: Wed Jun 10 14:41:41 2020 +0300
Commit:     Mert Tumer <mert.tu...@collabora.com>
CommitDate: Tue Aug 4 12:42:50 2020 +0200

    Fix .uno:SidebarHide command works for online
    
    Signed-off-by: Mert Tumer <mert.tu...@collabora.com>
    Change-Id: I03743d15300687b1da947d3c44be6a42aab83107
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96513
    Tested-by: Jenkins

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index e844243207d8..dc1b6b1664fc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -911,6 +911,16 @@ void setupSidebar(bool bShow)
         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;
@@ -3894,7 +3904,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
     }
     else if (gImpl && aCommand == ".uno:SidebarHide")
     {
-        setupSidebar(false);
+        hideSidebar();
         return;
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to