[Libreoffice-commits] .: 2 commits - dbaccess/source

Lionel Elie Mamane lmamane at kemper.freedesktop.org
Wed Feb 8 17:15:12 PST 2012


 dbaccess/source/core/api/RowSetCache.cxx |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

New commits:
commit bd9d0aa967eb69e436925fc64b16051019e6818d
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Thu Feb 9 02:14:05 2012 +0100

    Revert "Tentative fix for invalid iterator range regression"
    
    This reverts commit 23151ab53574e0e893f4507313ff15388638746a.
    
    Fixed root cause in previous commit.

diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index 04d1436..f2301f0 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -940,14 +940,7 @@ sal_Bool ORowSetCache::moveWindow()
                     bCheck = fill(aIter, aNewEnd, nPos, bCheck);
                 }
 
-                if ( aEnd <= aNewEnd )
-                {
-                    ::std::rotate(m_pMatrix->begin(), aEnd, aNewEnd);
-                }
-                else
-                {
-                    ::std::rotate(m_pMatrix->begin(), aNewEnd, aEnd);
-                }
+                ::std::rotate(m_pMatrix->begin(), aEnd, aNewEnd);
                 // 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();
commit 370fa77a418fe8903c48080db6e33a9cb8531869
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Wed Feb 8 19:08:20 2012 +0100

    ORowSetCache::moveWindow fix variable inversion; fixes subsequentcheck

diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index 77eae6e..04d1436 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -914,7 +914,7 @@ sal_Bool ORowSetCache::moveWindow()
             // m_nEndPos < nNewEndPos when window not filled (e.g. there are less rows in total than window size)
             m_nEndPos = std::min(nNewEndPos, m_nEndPos);
             const sal_Int32 nOverlapSize = m_nEndPos - m_nStartPos;
-            const sal_Int32 nStartPosOffset = nNewStartPos - m_nStartPos; // by how much m_nStartPos moves
+            const sal_Int32 nStartPosOffset = m_nStartPos - nNewStartPos; // by how much m_nStartPos moves
             m_nStartPos = nNewStartPos;
             OSL_ENSURE( static_cast<ORowSetMatrix::size_type>(nOverlapSize) <= m_pMatrix->size(), "new window end is after end of cache matrix!" );
             // the first position in m_pMatrix whos data we don't keep;


More information about the Libreoffice-commits mailing list