diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-05-17 10:54:40 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-05-21 17:42:03 +0000 |
commit | fd3e9a136da6f119e6f722ac409ff32bd52c8ea0 (patch) | |
tree | c2709a0d0f3be3c7123d8ba63dc8c3bd37cd8683 | |
parent | d7b428453b07f48b56e7d83f05d81fae91b921c8 (diff) |
fdo#47951 flat text table: update m_nRowPos when moving by bookmark
Change-Id: Iac154020b4b6309f92b1f68fa5bf79611dfcc91b
Reviewed-on: https://gerrit.libreoffice.org/3961
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-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 9fe48f0abe24..8ae79359a29a 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -869,15 +869,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) ) |