summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-05-08 03:03:19 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-05-08 03:06:29 +0200
commitcdcdeb933448e3519f1b3245f9f8428c941380b7 (patch)
tree1e0289d3d0f39b0a8adece2c9bad858ba51747a7
parent702953442ad26802ec47c0f6e1f446c0f1082de8 (diff)
fix another crash on exit
Change-Id: I580d17b16760516b73ac9f882fd8f9707ce6337b
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx2
-rw-r--r--sc/source/ui/inc/gridwin.hxx1
-rw-r--r--sc/source/ui/view/gridwin5.cxx13
3 files changed, 15 insertions, 1 deletions
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 4a4a0ac9ed41..1505b28d5ec7 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -730,7 +730,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
sal_Int16 nDialogRet = xDialog->execute();
if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
{
- delete pChildWindow;
+ pGridWindow->DeleteChildWindow(pChildWindow);
// leave OLE inplace mode and unmark
OSL_ASSERT( pViewShell );
OSL_ASSERT( pView );
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 5170e2567b0d..0a019357a5de 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -415,6 +415,7 @@ public:
* Takes ownership of the window
*/
void AddChildWindow(Window* pChildWindow);
+ void DeleteChildWindow(Window* pChildWindow);
protected:
// #114409#
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 798d34aafb71..a85a5497549d 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -479,4 +479,17 @@ void ScGridWindow::AddChildWindow(Window* pWindow)
maChildWindows.push_back(pWindow);
}
+void ScGridWindow::DeleteChildWindow(Window* pWindow)
+{
+ for(boost::ptr_vector<Window>::iterator itr = maChildWindows.begin(),
+ itrEnd = maChildWindows.end(); itr != itrEnd; ++itr)
+ {
+ if(&(*itr) == pWindow)
+ {
+ maChildWindows.erase(itr);
+ return;
+ }
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */