diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-05-17 10:54:40 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-05-19 14:05:17 +0200 |
commit | 6b946f228397c370e09f487c470bafd9d046eee5 (patch) | |
tree | 9d728db95d7f5abece432aef87f2c921fe2f8cf8 /connectivity | |
parent | dab009a4fcd2b558a055b917e5ff48bfb998689e (diff) |
fdo#47951 flat text table: update m_nRowPos when moving by bookmark
Change-Id: Iac154020b4b6309f92b1f68fa5bf79611dfcc91b
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/flat/ETable.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 083cad497a01..19918efd1cb3 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -863,15 +863,29 @@ sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int break; case IResultSetHelper::BOOKMARK: { + m_nRowPos = 0; TRowPositionsInFile::const_iterator aFind = m_aFilePosToEndLinePos.find(nOffset); m_bNeedToReadLine = aFind != m_aFilePosToEndLinePos.end(); if ( m_bNeedToReadLine ) { m_nFilePos = aFind->first; nCurPos = aFind->second; + for(::std::map<sal_Int32, TRowPositionsInFile::iterator>::const_iterator p = m_aRowPosToFilePos.begin(); + p != m_aRowPosToFilePos.end(); + ++p) + { + assert(p->second->first <= nOffset); + if(p->second->first == nOffset) + { + m_nRowPos = p->first; + break; + } + } + assert(m_nRowPos > 0); } else { + assert(false); m_nFilePos = nOffset; m_pFileStream->Seek(nOffset); if (m_pFileStream->IsEof() || !readLine(nCurPos) ) |