[PATCH libreoffice-3-6] 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:27:52 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3962

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/62/3962/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 b7f61ed..fc1124e 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -873,15 +873,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/3962
To unsubscribe, visit https://gerrit.libreoffice.org/settings

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



More information about the LibreOffice mailing list