sfx2/source/notebookbar/PriorityHBox.cxx | 11 +++++++---- sfx2/source/notebookbar/SfxNotebookBar.cxx | 8 +++++++- 2 files changed, 14 insertions(+), 5 deletions(-)
New commits: commit d8e91627b96e1325a8859d8ee54cdf5e15516bb9 Author: Szymon KÅos <eszka...@gmail.com> Date: Wed Sep 21 21:09:37 2016 +0200 tdf#101249 fixed crash after inserting OLE object Change-Id: I4ddd52f5da1745a2b9f2d6d54d5091d8f10107e7 Reviewed-on: https://gerrit.libreoffice.org/29155 Reviewed-by: Stephan Bergmann <sberg...@redhat.com> Tested-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sfx2/source/notebookbar/PriorityHBox.cxx b/sfx2/source/notebookbar/PriorityHBox.cxx index 46f6282..6071b7e 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 f3c3439..db8db52 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()) {
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits