tdf#73025: set absolute database index fixed

DB field 'Any record' should not move the ResultSet directly but needs
to work on the selection if there is any

Change-Id: Ie66cc66afa1118bfbc44fc29889e2b36ecd074ee
Reviewed-on: https://gerrit.libreoffice.org/21491
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Tested-by: Oliver Specht <oliver.specht@cib.de>
This commit is contained in:
Oliver Specht
2016-01-15 15:39:28 +00:00
parent 75358177cc
commit f5ccfd60c2
+18 -1
View File
@@ -332,7 +332,24 @@ static bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos)
bool bRet = false;
try
{
if(pParam->bScrollable)
if(pParam->aSelection.getLength())
{
if(pParam->aSelection.getLength() <= nAbsPos)
{
pParam->bEndOfDB = true;
bRet = false;
}
else
{
pParam->nSelectionIndex = nAbsPos;
sal_Int32 nPos = 0;
pParam->aSelection.getConstArray()[ pParam->nSelectionIndex ] >>= nPos;
pParam->bEndOfDB = !pParam->xResultSet->absolute( nPos );
pParam->CheckEndOfDB();
bRet = !pParam->bEndOfDB;
}
}
else if(pParam->bScrollable)
{
bRet = pParam->xResultSet->absolute( nAbsPos );
}