Tentative fix for invalid iterator range regression

37b5dce665 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.
This commit is contained in:
Stephan Bergmann 2012-02-08 21:51:38 +01:00
parent fb9908eece
commit 23151ab535

View file

@ -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();