summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-11-30 11:58:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-12-02 05:16:05 -0600
commitfb1206d6a86d6a9b0a898cb6d0c18d18d4c778e6 (patch)
tree5aecc5847f6ac23bca497438d44263e5a761e2c4 /connectivity
parenta9d6a9c78cccaa5068a21b9b0e526ab60bbcfabf (diff)
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/6864 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index f777e636dee8..d1cab112c5a2 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