summaryrefslogtreecommitdiff
path: root/sfx2/source/notebookbar/SfxNotebookBar.cxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2023-11-03 08:52:32 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2023-11-03 12:54:48 +0100
commit3d15de525534197960e9a9c64eba3ad2153aa113 (patch)
tree1963811ba59b04ff97ce65508f33fea85b5a7b25 /sfx2/source/notebookbar/SfxNotebookBar.cxx
parent4af07053517ba3526d4050ffc29993a65b54352b (diff)
lok: notebookbar: don't recreate toolbars too often
commit 004512d87ab70587d95a708116a5c2f4b870565c notebookbar: allow to create multiple instances for online Changed SfxNotebookBar::StateMethod so in LOK case it always enter to the code block which is meant to be used for creating or reloading notebookbar. Change that so we check if notebookbar was initialized for given view already. Change-Id: Icfa1e572769043509479b7b98d055120ac3d1f74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158872 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sfx2/source/notebookbar/SfxNotebookBar.cxx')
-rw-r--r--sfx2/source/notebookbar/SfxNotebookBar.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 0a21ffa98c8a..e9e85de271bd 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -377,11 +377,12 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
bool bChangedFile = sNewFile != sCurrentFile;
+ const SfxViewShell* pViewShell = SfxViewShell::Current();
+ bool hasWeldedWrapper = m_pNotebookBarWeldedWrapper.find(pViewShell) != m_pNotebookBarWeldedWrapper.end();
+
if ((!sFile.isEmpty() && bChangedFile) || !pNotebookBar || !pNotebookBar->IsVisible()
- || bReloadNotebookbar || comphelper::LibreOfficeKit::isActive())
+ || bReloadNotebookbar || (comphelper::LibreOfficeKit::isActive() && !hasWeldedWrapper))
{
- const SfxViewShell* pViewShell = SfxViewShell::Current();
-
// Notebookbar was loaded too early what caused:
// * in LOK: Paste Special feature was incorrectly initialized
// Skip first request so Notebookbar will be initialized after document was loaded
@@ -418,8 +419,6 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
pNotebookBar = pSysWindow->GetNotebookBar();
pNotebookBar->Show();
-
- bool hasWeldedWrapper = m_pNotebookBarWeldedWrapper.find(pViewShell) != m_pNotebookBarWeldedWrapper.end();
if ((!hasWeldedWrapper || bReloadNotebookbar) && pNotebookBar->IsWelded())
{
sal_uInt64 nWindowId = reinterpret_cast<sal_uInt64>(pViewShell);