[Libreoffice-commits] .: dbaccess/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Wed Feb 8 12:52:54 PST 2012


 dbaccess/source/core/api/RowSetCache.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 23151ab53574e0e893f4507313ff15388638746a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Feb 8 21:51:38 2012 +0100

    Tentative fix for invalid iterator range regression
    
    37b5dce665a03d3404e6a710b82bef16d740d178 re-wrote a std::rotate call to cause
    an "error: function requires a valid iterator range [__middle, __last)" abort
    from debug-mode GCC libstdc++ during smoketest.  Lionel should check whether
    this fix is actually good -- at least, it causes "make check" to succeed again.

diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index df833a2..77eae6e 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -940,7 +940,14 @@ sal_Bool ORowSetCache::moveWindow()
                     bCheck = fill(aIter, aNewEnd, nPos, bCheck);
                 }
 
-                ::std::rotate(m_pMatrix->begin(), aEnd, aNewEnd);
+                if ( aEnd <= aNewEnd )
+                {
+                    ::std::rotate(m_pMatrix->begin(), aEnd, aNewEnd);
+                }
+                else
+                {
+                    ::std::rotate(m_pMatrix->begin(), aNewEnd, aEnd);
+                }
                 // now correct the iterator in our iterator vector
                 //  rotateCacheIterator(aEnd-m_pMatrix->begin()); //can't be used because they decrement and here we need to increment
                 ORowSetCacheMap::iterator aCacheIter = m_aCacheIterators.begin();


More information about the Libreoffice-commits mailing list