[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sfx2/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Mon May 6 13:17:22 UTC 2019


 sfx2/source/sidebar/SidebarChildWindow.cxx   |    4 +--
 sfx2/source/sidebar/SidebarController.cxx    |   36 ++++++++++++++-------------
 sfx2/source/sidebar/SidebarDockingWindow.cxx |    2 -
 3 files changed, 22 insertions(+), 20 deletions(-)

New commits:
commit 5ddf630222241bec4deda56d10992c35ae4efe06
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun May 5 23:33:34 2019 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Mon May 6 15:16:30 2019 +0200

    LOK: support sidebars in writer and calc
    
    Change-Id: I3a3bd1fb6922e435599f604328f558be60594729
    Reviewed-on: https://gerrit.libreoffice.org/71843
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sfx2/source/sidebar/SidebarChildWindow.cxx b/sfx2/source/sidebar/SidebarChildWindow.cxx
index 6296c9fe05e0..890b7b8cb0a9 100644
--- a/sfx2/source/sidebar/SidebarChildWindow.cxx
+++ b/sfx2/source/sidebar/SidebarChildWindow.cxx
@@ -68,7 +68,7 @@ SidebarChildWindow::SidebarChildWindow(vcl::Window* pParentWindow, sal_uInt16 nI
         // Undock sidebar in LOK to allow for resizing freely
         // (i.e. when the client window is resized) and collapse
         // it so the client can open it on demand.
-        pDockWin->SetFloatingSize(Size(TabBar::GetDefaultWidth() * GetWindow()->GetDPIScaleFactor(),
+        pDockWin->SetFloatingSize(Size(pDockWin->GetSizePixel().Width() * GetWindow()->GetDPIScaleFactor(),
                                        pDockWin->GetSizePixel().Height()));
         pDockWin->SetFloatingMode(true);
     }
@@ -78,7 +78,7 @@ SidebarChildWindow::SidebarChildWindow(vcl::Window* pParentWindow, sal_uInt16 nI
     pDockWin->Show();
 }
 
-sal_Int32 SidebarChildWindow::GetDefaultWidth (vcl::Window const * pWindow)
+sal_Int32 SidebarChildWindow::GetDefaultWidth(vcl::Window const* pWindow)
 {
     if (pWindow != nullptr)
     {
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 420847351e53..876cae106319 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -464,7 +464,7 @@ void SidebarController::ProcessNewWidth (const sal_Int32 nNewWidth)
         return;
 
     if (mbIsDeckRequestedOpen.get())
-     {
+    {
         // Deck became large enough to be shown.  Show it.
         mnSavedSidebarWidth = nNewWidth;
         RequestOpenDeck();
@@ -719,6 +719,24 @@ void SidebarController::SwitchToDeck (
     const DeckDescriptor& rDeckDescriptor,
     const Context& rContext)
 {
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        if (const SfxViewShell* pViewShell = mpViewFrame->GetViewShell())
+        {
+            if (msCurrentDeckId != rDeckDescriptor.msId)
+            {
+                const std::string hide = UnoNameFromDeckId(msCurrentDeckId);
+                if (!hide.empty())
+                    pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                                                           (hide + "=false").c_str());
+            }
+
+            const std::string show = UnoNameFromDeckId(rDeckDescriptor.msId);
+            if (!show.empty())
+                pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                                                       (show + "=true").c_str());
+        }
+    }
 
     maFocusManager.Clear();
 
@@ -732,22 +750,6 @@ void SidebarController::SwitchToDeck (
         if (mpCurrentDeck)
             mpCurrentDeck->Hide();
 
-        if (comphelper::LibreOfficeKit::isActive())
-        {
-            if (const SfxViewShell* pViewShell = mpViewFrame->GetViewShell())
-            {
-                const std::string hide = UnoNameFromDeckId(msCurrentDeckId);
-                if (!hide.empty())
-                    pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
-                                                           (hide + "=false").c_str());
-
-                const std::string show = UnoNameFromDeckId(rDeckDescriptor.msId);
-                if (!show.empty())
-                    pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
-                                                           (show + "=true").c_str());
-            }
-        }
-
         msCurrentDeckId = rDeckDescriptor.msId;
     }
     mpTabBar->HighlightDeck(msCurrentDeckId);
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 4264dbb234aa..8bd5fa307892 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -109,7 +109,7 @@ void SidebarDockingWindow::NotifyResize()
         // Note: this means we *cannot* create a sidebar post attaching a new view because the
         // ViewShell will not change, and therefore we will never SetLOKNotifier. To avoid that
         // we hide sidebars instead of closing (see OnMenuItemSelected in SidebarController).
-        if (mpSidebarController.is() && !GetLOKNotifier() && mpOldViewShell != SfxViewShell::Current())
+        if (mpSidebarController.is() && !GetLOKNotifier())
             SetLOKNotifier(SfxViewShell::Current());
 
         if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())


More information about the Libreoffice-commits mailing list