[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - 2 commits - connectivity/source
Lionel Elie Mamane
lionel at mamane.lu
Mon Dec 2 03:16:30 PST 2013
connectivity/source/drivers/file/FResultSet.cxx | 6 +++++-
connectivity/source/drivers/flat/ETable.cxx | 7 ++++---
2 files changed, 9 insertions(+), 4 deletions(-)
New commits:
commit f4125fefab88b58c47a763af01daf1c3e15de15e
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Sat Nov 30 11:54:20 2013 +0100
fdo#72148 if expecting table at begin, explicitly set it so
Change-Id: Ic876603e5860b987280b73726fd79a071a9c833c
Reviewed-on: https://gerrit.libreoffice.org/6863
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index be363b3..180fd01 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -1094,7 +1094,11 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32
else // Index must be further constructed
{
// set first on the last known row
- if (!m_pFileSet->get().empty())
+ if (m_pFileSet->get().empty())
+ {
+ m_pTable->seekRow(IResultSetHelper::ABSOLUTE, 0, m_nFilePos);
+ }
+ else
{
m_aFileSetIter = m_pFileSet->get().end()-1;
m_pTable->seekRow(IResultSetHelper::BOOKMARK, *m_aFileSetIter, m_nFilePos);
commit fb1206d6a86d6a9b0a898cb6d0c18d18d4c778e6
Author: Lionel Elie Mamane <lionel at 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/6864
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at 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
More information about the Libreoffice-commits
mailing list