notebookbar: control early init per view
Change-Id: I9b743bc6d62256289549cd8002b76bcb918222b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99986 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit fddfeb653dfd5dd73cbccb4433678d397f092df9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99921 Tested-by: Jenkins
This commit is contained in:
parent
7959953e99
commit
adb901ca11
@ -30,6 +30,7 @@
|
|||||||
#include <framework/addonsoptions.hxx>
|
#include <framework/addonsoptions.hxx>
|
||||||
#include <vcl/NotebookBarAddonsMerger.hxx>
|
#include <vcl/NotebookBarAddonsMerger.hxx>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
#include <vcl/WeldedTabbedNotebookbar.hxx>
|
#include <vcl/WeldedTabbedNotebookbar.hxx>
|
||||||
|
|
||||||
using namespace sfx2;
|
using namespace sfx2;
|
||||||
@ -366,13 +367,16 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
|
|||||||
if ((!sFile.isEmpty() && bChangedFile) || !pNotebookBar || !pNotebookBar->IsVisible()
|
if ((!sFile.isEmpty() && bChangedFile) || !pNotebookBar || !pNotebookBar->IsVisible()
|
||||||
|| bReloadNotebookbar || comphelper::LibreOfficeKit::isActive())
|
|| bReloadNotebookbar || comphelper::LibreOfficeKit::isActive())
|
||||||
{
|
{
|
||||||
|
const SfxViewShell* pViewShell = SfxViewShell::Current();
|
||||||
|
|
||||||
// Notebookbar was loaded too early what caused:
|
// Notebookbar was loaded too early what caused:
|
||||||
// * in LOK: Paste Special feature was incorrectly initialized
|
// * in LOK: Paste Special feature was incorrectly initialized
|
||||||
// Skip first request so Notebookbar will be initialized after document was loaded
|
// Skip first request so Notebookbar will be initialized after document was loaded
|
||||||
static bool bSkipFirstInit = true;
|
static std::map<const void*, bool> bSkippedFirstInit;
|
||||||
if (comphelper::LibreOfficeKit::isActive() && bSkipFirstInit)
|
if (comphelper::LibreOfficeKit::isActive()
|
||||||
|
&& bSkippedFirstInit.find(pViewShell) == bSkippedFirstInit.end())
|
||||||
{
|
{
|
||||||
bSkipFirstInit = false;
|
bSkippedFirstInit[pViewShell] = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,7 +397,6 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
|
|||||||
pNotebookBar = pSysWindow->GetNotebookBar();
|
pNotebookBar = pSysWindow->GetNotebookBar();
|
||||||
pNotebookBar->Show();
|
pNotebookBar->Show();
|
||||||
|
|
||||||
const SfxViewShell* pViewShell = SfxViewShell::Current();
|
|
||||||
|
|
||||||
bool hasWeldedWrapper = m_pNotebookBarWeldedWrapper.find(pViewShell) != m_pNotebookBarWeldedWrapper.end();
|
bool hasWeldedWrapper = m_pNotebookBarWeldedWrapper.find(pViewShell) != m_pNotebookBarWeldedWrapper.end();
|
||||||
if ((!hasWeldedWrapper || bReloadNotebookbar) && pNotebookBar->IsWelded())
|
if ((!hasWeldedWrapper || bReloadNotebookbar) && pNotebookBar->IsWelded())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user