From 178a23a827f16e046e5d5efb2aa2aa3fc990452a Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Thu, 1 Sep 2016 20:35:51 +0200 Subject: MM just increment after a successful next record This correctly counts the record id from 1, while using 0 for the first item in the selection array. Change-Id: I363eab048cb041bf46454ef685baab1eb3b2138a --- sw/source/uibase/dbui/dbmgr.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sw/source/uibase') diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 077d4e63b3cd..238f62d2e536 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -2178,7 +2178,7 @@ static bool lcl_ToNextRecord( SwDSParam* pParam, const SwDBNextRecord action ) else { sal_Int32 nPos = 0; - pParam->aSelection.getConstArray()[ pParam->nSelectionIndex++ ] >>= nPos; + pParam->aSelection.getConstArray()[ pParam->nSelectionIndex ] >>= nPos; pParam->bEndOfDB = !pParam->xResultSet->absolute( nPos ); } } @@ -2193,11 +2193,11 @@ static bool lcl_ToNextRecord( SwDSParam* pParam, const SwDBNextRecord action ) if( !pParam->bEndOfDB && nBefore == pParam->xResultSet->getRow() ) { // next returned true but it didn't move - pParam->bEndOfDB = true; + ::dbtools::throwFunctionSequenceException( pParam->xResultSet ); } - ++pParam->nSelectionIndex; } + ++pParam->nSelectionIndex; bRet = !pParam->bEndOfDB; } catch( const uno::Exception &e ) -- cgit v1.2.3