summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-03-09 09:45:53 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-03-09 09:50:08 +0000
commit29fc44c6f8478f218d7b9959cf8a9e7141a26ce6 (patch)
treeb42e2806ff8d04f776af3ce983e3f01afff0417a /dbaccess
parentc8a93253e43e81e5dbc89937f2a21ca75e0582bc (diff)
fix debugging stl iterators assert in bibliography toolbar
bibliography: click autofilter toolbar icon to get drop down, select an entry and assert on use of invalid iterators. In this specific case we want to reset them all, so add a new simpler method to just do that and not do the (always supposed to be true) comparison note: in ORowSet::checkUpdateIterator at m_aCurrentRow = m_pCache->m_aInsertRow; these iterators are then invalid the whole iterator caching and fiddling here is concerning. Change-Id: I74952896f47ac482b6bacb26afe5b1cfcf6bc49c
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/RowSetCache.cxx15
-rw-r--r--dbaccess/source/core/api/RowSetCache.hxx1
2 files changed, 15 insertions, 1 deletions
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index 1d4970a97181..f298c4455db3 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -1488,6 +1488,19 @@ void ORowSetCache::rotateCacheIterator(ORowSetMatrix::difference_type _nDist)
}
}
+void ORowSetCache::rotateAllCacheIterators()
+{
+ // now correct the iterator in our iterator vector
+ auto aCacheEnd = m_aCacheIterators.end();
+ for (auto aCacheIter = m_aCacheIterators.begin(); aCacheIter != aCacheEnd; ++aCacheIter)
+ {
+ if (!aCacheIter->second.pRowSet->isInsertRow() && !m_bModified)
+ {
+ aCacheIter->second.aIterator = m_pMatrix->end();
+ }
+ }
+}
+
void ORowSetCache::setUpdateIterator(const ORowSetMatrix::iterator& _rOriginalRow)
{
m_aInsertRow = m_pInsertMatrix->begin();
@@ -1676,7 +1689,7 @@ bool ORowSetCache::reFillMatrix(sal_Int32 _nNewStartPos, sal_Int32 _nNewEndPos)
bool bRet = fillMatrix(nNewSt,_nNewEndPos);
m_nStartPos = nNewSt;
m_nEndPos = _nNewEndPos;
- rotateCacheIterator(static_cast<ORowSetMatrix::difference_type>(m_nFetchSize+1)); // invalidate every iterator
+ rotateAllCacheIterators(); // invalidate every iterator
return bRet;
}
diff --git a/dbaccess/source/core/api/RowSetCache.hxx b/dbaccess/source/core/api/RowSetCache.hxx
index a41aaf7d0f1b..86bb8ccfe355 100644
--- a/dbaccess/source/core/api/RowSetCache.hxx
+++ b/dbaccess/source/core/api/RowSetCache.hxx
@@ -100,6 +100,7 @@ namespace dbaccess
void moveWindow();
void rotateCacheIterator(ORowSetMatrix::difference_type _nDist);
+ void rotateAllCacheIterators();
void updateValue(sal_Int32 columnIndex
,const connectivity::ORowSetValue& x
,ORowSetValueVector::Vector& io_aRow