Kaydet (Commit) 3faf9c4a authored tarafından Philippe Jung's avatar Philippe Jung Kaydeden (comit) Michael Meeks

Fix a crash in SfxInfoBarWindow

Fix a crash that occurs when a locked doc is opened. Ask to open it
read-only, then click on Edit the document in the info bar. Used to
crash.

Change-Id: Ic6e53853345e9e8431cae0eb2408ab0624d92cce
üst cc444e08
...@@ -283,17 +283,21 @@ SfxInfoBarWindow* SfxInfoBarContainerWindow::getInfoBar(const OUString& sId) ...@@ -283,17 +283,21 @@ SfxInfoBarWindow* SfxInfoBarContainerWindow::getInfoBar(const OUString& sId)
void SfxInfoBarContainerWindow::removeInfoBar(SfxInfoBarWindow* pInfoBar) void SfxInfoBarContainerWindow::removeInfoBar(SfxInfoBarWindow* pInfoBar)
{ {
// Store a VclPtr to the pInfoBar while we remove it from m_pInfoBars
ScopedVclPtr<SfxInfoBarWindow> pTmp(pInfoBar);
// Remove
for (auto it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it) for (auto it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
{ {
if (pInfoBar == it->get()) if (pInfoBar == it->get())
{ {
it->disposeAndClear();
m_pInfoBars.erase(it); m_pInfoBars.erase(it);
break; break;
} }
} }
if (pInfoBar)
pInfoBar->disposeOnce();
// Resize
long nY = 0; long nY = 0;
for (auto it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it) for (auto it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment