diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2016-09-21 21:09:37 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-09-26 12:21:50 +0000 |
commit | d8e91627b96e1325a8859d8ee54cdf5e15516bb9 (patch) | |
tree | f2482d568a739e9fdc7e42009fb3141329868e84 /sfx2 | |
parent | b9cc6653606c829805c6c01b9613a3a25d81c20b (diff) |
tdf#101249 fixed crash after inserting OLE object
Change-Id: I4ddd52f5da1745a2b9f2d6d54d5091d8f10107e7
Reviewed-on: https://gerrit.libreoffice.org/29155
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sfx2')
-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()) { |