summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-09-09 16:05:12 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2022-09-26 10:23:48 +0200
commitcd0e3d61f2285b81d9c2bd8fa3d12e0deb505681 (patch)
tree0c99ff3752bead205e6dca3ce1c013def86a0476 /sfx2
parentdb106346a9797565e406cf9c26e762327446f59a (diff)
lok: create sidebar on demand
Change-Id: I5393bba647aa4667643262e77acc6b6873afb571 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139729 Reviewed-by: Ashod Nakashian <ash@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140580 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/SidebarDockingWindow.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 18000601bfd0..23c3b459c3be 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -22,6 +22,7 @@
#include <sidebar/PanelDescriptor.hxx>
#include <comphelper/dispatchcommand.hxx>
+#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
@@ -49,11 +50,21 @@ SidebarDockingWindow::SidebarDockingWindow(SfxBindings* pSfxBindings, SidebarChi
OSL_ASSERT(pSfxBindings!=nullptr);
OSL_ASSERT(pSfxBindings->GetDispatcher()!=nullptr);
}
- else
+ else if (!comphelper::LibreOfficeKit::isActive())
{
- const SfxViewFrame* pViewFrame = pSfxBindings->GetDispatcher()->GetFrame();
+ GetOrCreateSidebarController();
+ }
+}
+
+rtl::Reference<sfx2::sidebar::SidebarController>& SidebarDockingWindow::GetOrCreateSidebarController()
+{
+ if (!mpSidebarController)
+ {
+ const SfxViewFrame* pViewFrame = GetBindings().GetDispatcher()->GetFrame();
mpSidebarController = sfx2::sidebar::SidebarController::create(this, pViewFrame);
}
+
+ return mpSidebarController;
}
SidebarDockingWindow::~SidebarDockingWindow()