diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2016-09-27 13:50:35 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2016-09-27 12:29:05 +0000 |
commit | 9b8e77e2936d3dc44450a68a80de39658d69cd17 (patch) | |
tree | 8fc86bcbf904293ebac0078382b55b055fbb118e /sfx2 | |
parent | 3468dab9ff02ecdf5d0806a00e15b9b579c8dc35 (diff) |
tdf#101249 fixed crash after inserting OLE object 2
Change-Id: I1997e69e09cfae10b26a3b3e851583714ee9b3e9
Reviewed-on: https://gerrit.libreoffice.org/29318
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <eszkadev@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/notebookbar/PriorityHBox.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sfx2/source/notebookbar/PriorityHBox.cxx b/sfx2/source/notebookbar/PriorityHBox.cxx index 6071b7e2578d..307bad56293d 100644 --- a/sfx2/source/notebookbar/PriorityHBox.cxx +++ b/sfx2/source/notebookbar/PriorityHBox.cxx @@ -42,6 +42,8 @@ private: bool m_bInitialized; long m_nNeededWidth; + ScopedVclPtr<SystemWindow> m_pSystemWindow; + std::vector<IPrioritable*> m_aSortedChilds; public: @@ -59,10 +61,10 @@ public: virtual void dispose() override { - if (m_bInitialized && SfxViewFrame::Current()) + if (m_pSystemWindow) { - SystemWindow* pSystemWindow = SfxViewFrame::Current()->GetFrame().GetSystemWindow(); - pSystemWindow->RemoveEventListener(LINK(this, PriorityHBox, WindowEventListener)); + m_pSystemWindow->RemoveEventListener(LINK(this, PriorityHBox, WindowEventListener)); + m_pSystemWindow.clear(); } VclHBox::dispose(); } @@ -99,14 +101,14 @@ public: { m_bInitialized = true; - SystemWindow* pSystemWindow = SfxViewFrame::Current()->GetFrame().GetSystemWindow(); - if (pSystemWindow) + m_pSystemWindow = SfxViewFrame::Current()->GetFrame().GetSystemWindow(); + if (m_pSystemWindow) { - pSystemWindow->AddEventListener(LINK(this, PriorityHBox, WindowEventListener)); + m_pSystemWindow->AddEventListener(LINK(this, PriorityHBox, WindowEventListener)); CalcNeededWidth(); - long nWidth = pSystemWindow->GetSizePixel().Width(); + long nWidth = m_pSystemWindow->GetSizePixel().Width(); SetSizePixel(Size(nWidth, GetSizePixel().Height())); } } |