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

New commits:
commit 23151ab53574e0e893f4507313ff15388638746a
Author: Stephan Bergmann <sberg...@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();
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to