Notebookbar: skip early init
This will prevent us from hanging in the start
center during notebookbar initialization.
Also prevents from bugs due to uno state querying
too early: eg. Paste Special was not working in LOK.
Change-Id: I0ac619a4c8b629eced0eb6ba6992897569f7263a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99856
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
(cherry picked from commit 5ca41b36d8d49882d51386da9f41135bfdc9257a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99837
Tested-by: Jenkins
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index ab2bc14..41d6522 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -366,6 +366,17 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
if ((!sFile.isEmpty() && bChangedFile) || !pNotebookBar || !pNotebookBar->IsVisible()
|| bReloadNotebookbar || comphelper::LibreOfficeKit::isActive())
{
// Notebookbar was loaded too early what caused:
// * little hang in the start center on desktop
// * in LOK: Paste Special feature was incorrectly initialized
// Skip first request so Notebookbar will be initialized after document was loaded
static bool bSkipFirstInit = true;
if (bSkipFirstInit)
{
bSkipFirstInit = false;
return false;
}
RemoveListeners(pSysWindow);
OUString aBuf = rUIFile + sFile;