summaryrefslogtreecommitdiffstats
path: root/sfx2/source/notebookbar/SfxNotebookBar.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/notebookbar/SfxNotebookBar.cxx')
-rw-r--r--sfx2/source/notebookbar/SfxNotebookBar.cxx14
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)