[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue May 24 18:44:45 PDT 2011


 sc/source/core/tool/rangelst.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit e6572364df84f6e815b2abbb61ba17e185aba60e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed May 25 01:21:30 2011 +0200

    remove problem inserted by a DECLARE_LIST removal
    
    the DECLARE_LIST container decremented the internal index pointin to the current element when REMOVE was called, when we now iterate over the new container and remove an element we must do this ourself

diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 0d57c75..3f46ebd 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -315,6 +315,7 @@ void ScRangeList::Join( const ScRange& r, bool bIsInList )
             if ( bIsInList )
             {	// innerhalb der Liste Range loeschen
                 Remove(nOldPos);
+                i--;
                 delete pOver;
                 pOver = NULL;
                 if ( nOldPos )
@@ -804,7 +805,7 @@ void ScRangePairList::Join( const ScRangePair& r, bool bIsInList )
     }
     bool bJoinedInput = false;
 
-    for ( size_t i = 0, nPairs = maPairs.size(); i < nPairs && pOver; ++i )
+    for ( size_t i = 0; i < maPairs.size() && pOver; ++i )
     {
         ScRangePair* p = maPairs[ i ];
         if ( p == pOver )
@@ -878,6 +879,7 @@ void ScRangePairList::Join( const ScRangePair& r, bool bIsInList )
             if ( bIsInList )
             {	// innerhalb der Liste RangePair loeschen
                 Remove( nOldPos );
+                i--;
                 delete pOver;
                 pOver = NULL;
                 if ( nOldPos )


More information about the Libreoffice-commits mailing list