summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-12-09 18:50:56 -0500
committerKohei Yoshida <kyoshida@novell.com>2010-12-09 18:50:56 -0500
commit3d0d8fb2d8e31a5acd427c8dbc70854d0f938d6b (patch)
treedfb47c80b26c0bfc9581b2ce47d4f10f6d903e88 /sc/source
parent7a37b8be2239133a2a5df51285db93f22ed81c99 (diff)
Delete its objects before removing pointers.
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/tool/rangelst.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 12962a4a7..19b36396e 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -48,6 +48,9 @@
ScRangeList::~ScRangeList()
{
+ std::vector<ScRangePtr>::iterator itr = begin(), itrEnd = end();
+ for (; itr != itrEnd; ++itr)
+ delete *itr;
clear();
}
@@ -148,7 +151,7 @@ void ScRangeList::Join( const ScRange& r, bool bIsInList )
}
bool bJoinedInput = false;
- for ( size_t i = 0, nRanges = size(); i < nRanges; ++i )
+ for ( size_t i = 0, nRanges = size(); i < nRanges && pOver; ++i )
{
ScRangePtr p = at( i );
if ( p == pOver )
@@ -203,6 +206,7 @@ void ScRangeList::Join( const ScRange& r, bool bIsInList )
if ( bIsInList )
{ // innerhalb der Liste Range loeschen
erase( begin() + nOldPos );
+ delete pOver;
pOver = NULL;
if ( nOldPos )
nOldPos--; // Seek richtig aufsetzen