summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-11-30 11:58:39 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2013-11-30 12:07:46 +0100
commit829621680b028909d58b0480a78a6aee7154f31a (patch)
treea3a7247094ed7bbaa7211f46e3ccb9e3cf2a1263 /connectivity
parentbe6bed2ca4083039bfcbd62f9603efa3a0bdd3dc (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. Change-Id: I629b71936f82a468febe0360909264dd80304437
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx17
1 files changed, 4 insertions, 13 deletions
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index f30f467e2047..acf98125a25f 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -761,22 +761,13 @@ void OFlatTable::refreshHeader()
// -----------------------------------------------------------------------------
namespace
{
- template< typename Tp, typename Te> struct PairFirstLess
+ template< typename Tp, typename Te> struct RangeBefore
{
bool operator() (const Tp &p, const Te &e)
{
- return p.first < e;
+ assert(p.first <= p.second);
+ return p.second <= e;
}
-#ifdef DBG_UTIL
- bool operator() (const Te &e, const Tp &p)
- {
- return e < p.first;
- }
- bool operator() (const Tp &p1, const Tp &p2)
- {
- return p1.first < p2.first;
- }
-#endif
};
}
// -----------------------------------------------------------------------------
@@ -915,7 +906,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