diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-08-04 17:06:36 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-08-05 00:36:47 +0200 |
commit | b032f21b5ea0011f2b134d758b696604c18dfa16 (patch) | |
tree | c9677f0ddc5fa30f6d244d270fb4049e17b807fe /connectivity | |
parent | 1aff997f632d6ebf710dbd69edb6a040998ee38e (diff) |
refactor to remove the gotos
no logic change intended
Change-Id: Ia787ff543ce7d55511656f5a462438378654f325
Reviewed-on: https://gerrit.libreoffice.org/40774
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/component/CTable.cxx | 46 |
1 files changed, 20 insertions, 26 deletions
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; } |