[Libreoffice-commits] core.git: connectivity/source
Caolán McNamara
caolanm at redhat.com
Fri Aug 4 22:37:21 UTC 2017
connectivity/source/drivers/component/CTable.cxx | 46 ++++++++++-------------
1 file changed, 20 insertions(+), 26 deletions(-)
New commits:
commit b032f21b5ea0011f2b134d758b696604c18dfa16
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 4 17:06:36 2017 +0100
refactor to remove the gotos
no logic change intended
Change-Id: Ia787ff543ce7d55511656f5a462438378654f325
Reviewed-on: https://gerrit.libreoffice.org/40774
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
diff --git a/connectivity/source/drivers/component/CTable.cxx b/connectivity/source/drivers/component/CTable.cxx
index a58978a84c18..a7e17a658874 100644
--- a/connectivity/source/drivers/component/CTable.cxx
+++ b/connectivity/source/drivers/component/CTable.cxx
@@ -181,36 +181,30 @@ bool OComponentTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_In
m_nFilePos = (sal_Int32)nNumberOfRecords + 1;
if (m_nFilePos == 0 || m_nFilePos == (sal_Int32)nNumberOfRecords + 1)
- goto Error;
- else
{
- //! read buffer / setup row object etc?
- }
- goto End;
-
-Error:
- switch(eCursorPosition)
- {
- case IResultSetHelper::PRIOR:
- case IResultSetHelper::FIRST:
- m_nFilePos = 0;
- break;
- case IResultSetHelper::LAST:
- case IResultSetHelper::NEXT:
- case IResultSetHelper::ABSOLUTE1:
- case IResultSetHelper::RELATIVE1:
- if (nOffset > 0)
- m_nFilePos = nNumberOfRecords + 1;
- else if (nOffset < 0)
+ switch(eCursorPosition)
+ {
+ case IResultSetHelper::PRIOR:
+ case IResultSetHelper::FIRST:
m_nFilePos = 0;
- break;
- case IResultSetHelper::BOOKMARK:
- m_nFilePos = nTempPos; // previous position
+ break;
+ case IResultSetHelper::LAST:
+ case IResultSetHelper::NEXT:
+ case IResultSetHelper::ABSOLUTE1:
+ case IResultSetHelper::RELATIVE1:
+ if (nOffset > 0)
+ m_nFilePos = nNumberOfRecords + 1;
+ else if (nOffset < 0)
+ m_nFilePos = 0;
+ break;
+ case IResultSetHelper::BOOKMARK:
+ m_nFilePos = nTempPos; // previous position
+ break;
+ }
+ return false;
}
- // aStatus.Set(SDB_STAT_NO_DATA_FOUND);
- return false;
-End:
+ //! read buffer / setup row object etc?
nCurPos = m_nFilePos;
return true;
}
More information about the Libreoffice-commits
mailing list