diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 05:03:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 05:03:24 +0000 |
commit | e3cf16e6fbf8d39cad8762f002b6db1d4f61ed36 (patch) | |
tree | 3c1753125149dcf36ba42a57f1574369e8524225 /sfx2/source/notebookbar/SfxNotebookBar.cxx | |
parent | Adding debian version 4:24.2.2-3. (diff) | |
download | libreoffice-e3cf16e6fbf8d39cad8762f002b6db1d4f61ed36.tar.xz libreoffice-e3cf16e6fbf8d39cad8762f002b6db1d4f61ed36.zip |
Merging upstream version 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) |