summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorPhilippe Jung <phil.jung@free.fr>2015-05-07 10:15:46 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-05-07 11:12:44 +0100
commit3faf9c4a2a5d2f761dc83b942199f55cdbd5f054 (patch)
tree284e369f2aa80bcc64ef3b033eb9d98d3afa6023 /sfx2
parentcc444e083c59ffcd73520faf55a28f55cfcb0068 (diff)
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
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/infobar.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index ff91cc64ee27..3c2c197d0ecc 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -283,17 +283,21 @@ SfxInfoBarWindow* SfxInfoBarContainerWindow::getInfoBar(const OUString& sId)
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)
{
if (pInfoBar == it->get())
{
+ it->disposeAndClear();
m_pInfoBars.erase(it);
break;
}
}
- if (pInfoBar)
- pInfoBar->disposeOnce();
+ // Resize
long nY = 0;
for (auto it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
{