summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-02-08 21:51:38 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-02-08 21:52:37 +0100
commit23151ab53574e0e893f4507313ff15388638746a (patch)
tree3c39106923c19c4e413f9acc3cf4b782763a9eff
parentfb9908eece3076ad88c160654450d3069d28c0d8 (diff)
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.
-rw-r--r--dbaccess/source/core/api/RowSetCache.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index df833a2e11f0..77eae6efdf62 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();