Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


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@mamane.lu>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.