connectivity/source/drivers/flat/ETable.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit a9ba6f0c54f325cadc14897471591251736157d9
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sat Nov 30 11:58:39 2013 +0100

    flat text DB: fix move by bookmark
    
    To test whether the range [a,b( is *before* e,
    compare e to b, not to a.
    
    This makes a difference when a==b, which happens for row 0 (header)
    when there is no header.
    
    Conflicts:
        connectivity/source/drivers/flat/ETable.cxx
    
    Change-Id: I629b71936f82a468febe0360909264dd80304437
    Reviewed-on: https://gerrit.libreoffice.org/6866
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    Tested-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/connectivity/source/drivers/flat/ETable.cxx 
b/connectivity/source/drivers/flat/ETable.cxx
index f777e63..d1cab11 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -757,9 +757,10 @@ void OFlatTable::refreshHeader()
 // 
-----------------------------------------------------------------------------
 namespace
 {
-    template< typename Tp, typename Te> bool pairFirstLess(const Tp &p, const 
Te &e)
+    template< typename Tp, typename Te> bool RangeBefore(const Tp &p, const Te 
&e)
     {
-        return p.first < e;
+        assert(p.first <= p.second);
+        return p.second <= e;
     }
 }
 // 
-----------------------------------------------------------------------------
@@ -898,7 +899,7 @@ sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement 
eCursorPosition, sal_Int
                 vector< TRowPositionInFile >::const_iterator aFind = 
lower_bound(m_aRowPosToFilePos.begin(),
                                                                                
  m_aRowPosToFilePos.end(),
                                                                                
  nOffset,
-                                                                               
  pairFirstLess< TRowPositionInFile, sal_Int32 >);
+                                                                               
  RangeBefore< TRowPositionInFile, sal_Int32 >);
 
                 if(aFind == m_aRowPosToFilePos.end() || aFind->first != 
nOffset)
                     //invalid bookmark
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to