summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-05-17 10:54:40 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-05-21 17:42:21 +0000
commit8f3147df3c309127382f800f9a2b19f355bd9d15 (patch)
tree555ad6098169dee6135f6d3065e47a5f68ae39cf
parent145d46663e2d9872b42cd7d4b8f6f76d672a883f (diff)
fdo#47951 flat text table: update m_nRowPos when moving by bookmark
Change-Id: Iac154020b4b6309f92b1f68fa5bf79611dfcc91b Reviewed-on: https://gerrit.libreoffice.org/3962 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index b7f61ed89ba5..fc1124ecde0c 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -873,15 +873,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) )