Avoid seeking a cursor to where it already is

Change-Id: I817aef57f3e028d77cf13f8cca1ecc7afcea9725
This commit is contained in:
Lionel Elie Mamane
2012-12-06 13:22:55 +01:00
parent dbafb1663e
commit 33af123fa0

View File

@@ -2447,10 +2447,20 @@ sal_Bool DbGridControl::SeekCursor(long nRow, sal_Bool bAbsolute)
if (!bSuccess)
{
if (bAbsolute || nSteps > 0)
{
if (m_pSeekCursor->isLast())
bSuccess=sal_True;
else
bSuccess = m_pSeekCursor->last();
}
else
{
if (m_pSeekCursor->isFirst())
bSuccess = sal_True;
else
bSuccess = m_pSeekCursor->first();
}
}
if (bSuccess)
m_nSeekPos = m_pSeekCursor->getRow() - 1;