[PATCH libreoffice-4-0] fdo#47951 flat text table: update m_nRowPos when moving by b...

Lionel Elie Mamane (via Code Review) gerrit at gerrit.libreoffice.org
Sun May 19 04:26:27 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3961

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/61/3961/1

fdo#47951 flat text table: update m_nRowPos when moving by bookmark

Change-Id: Iac154020b4b6309f92b1f68fa5bf79611dfcc91b
---
M connectivity/source/drivers/flat/ETable.cxx
1 file changed, 14 insertions(+), 0 deletions(-)



diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 9fe48f0..8ae7935 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -869,15 +869,29 @@
             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) )

-- 
To view, visit https://gerrit.libreoffice.org/3961
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac154020b4b6309f92b1f68fa5bf79611dfcc91b
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Lionel Elie Mamane <lionel at mamane.lu>



More information about the LibreOffice mailing list