diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 05:03:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 05:03:13 +0000 |
commit | 26f6ae4122fcce6bafa71c064f5e645c39022082 (patch) | |
tree | b0e0916f682785b3a983b71950c4623988ca6eef /sfx2/source/notebookbar/SfxNotebookBar.cxx | |
parent | Adding upstream version 4:24.2.2. (diff) | |
download | libreoffice-upstream/4%24.2.3.tar.xz libreoffice-upstream/4%24.2.3.zip |
Adding upstream version 4:24.2.3.upstream/4%24.2.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sfx2/source/notebookbar/SfxNotebookBar.cxx')
-rw-r--r-- | sfx2/source/notebookbar/SfxNotebookBar.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index 8e9c2c9ca4..69d41b04d8 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -418,6 +418,9 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, if (bIsLOK) { + if (!pViewShell) + return false; + // 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 @@ -608,11 +611,12 @@ void SfxNotebookBar::ToggleMenubar() void SfxNotebookBar::ReloadNotebookBar(std::u16string_view sUIPath) { - if (SfxNotebookBar::IsActive()) - { - SfxViewShell* pViewShell = SfxViewShell::Current(); - sfx2::SfxNotebookBar::StateMethod(pViewShell->GetViewFrame().GetBindings(), sUIPath, true); - } + if (!SfxNotebookBar::IsActive()) + return; + SfxViewShell* pViewShell = SfxViewShell::Current(); + if (!pViewShell) + return; + sfx2::SfxNotebookBar::StateMethod(pViewShell->GetViewFrame().GetBindings(), sUIPath, true); } IMPL_STATIC_LINK(SfxNotebookBar, VclDisposeHdl, const SfxViewShell*, pViewShell, void) |