diff options
-rw-r--r-- | sfx2/source/notebookbar/PriorityHBox.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/notebookbar/SfxNotebookBar.cxx | 8 |
2 files changed, 14 insertions, 5 deletions
diff --git a/sfx2/source/notebookbar/PriorityHBox.cxx b/sfx2/source/notebookbar/PriorityHBox.cxx index 46f62827f254..6071b7e2578d 100644 --- a/sfx2/source/notebookbar/PriorityHBox.cxx +++ b/sfx2/source/notebookbar/PriorityHBox.cxx @@ -100,12 +100,15 @@ public: m_bInitialized = true; SystemWindow* pSystemWindow = SfxViewFrame::Current()->GetFrame().GetSystemWindow(); - pSystemWindow->AddEventListener(LINK(this, PriorityHBox, WindowEventListener)); + if (pSystemWindow) + { + pSystemWindow->AddEventListener(LINK(this, PriorityHBox, WindowEventListener)); - CalcNeededWidth(); + CalcNeededWidth(); - long nWidth = pSystemWindow->GetSizePixel().Width(); - SetSizePixel(Size(nWidth, GetSizePixel().Height())); + long nWidth = pSystemWindow->GetSizePixel().Width(); + SetSizePixel(Size(nWidth, GetSizePixel().Height())); + } } VclHBox::Paint(rRenderContext, rRect); diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index f3c343902834..db8db52ca529 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -242,7 +242,13 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, const Reference<css::frame::XFrame> & xFrame, const OUString& rUIFile) { - assert(pSysWindow); + if (!pSysWindow) + { + if (SfxViewFrame::Current() && SfxViewFrame::Current()->GetWindow().GetSystemWindow()) + pSysWindow = SfxViewFrame::Current()->GetWindow().GetSystemWindow(); + else + return false; + } if (IsActive()) { |