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,9 +2447,19 @@ sal_Bool DbGridControl::SeekCursor(long nRow, sal_Bool bAbsolute)
if (!bSuccess)
{
if (bAbsolute || nSteps > 0)
bSuccess = m_pSeekCursor->last();
{
if (m_pSeekCursor->isLast())
bSuccess=sal_True;
else
bSuccess = m_pSeekCursor->last();
}
else
bSuccess = m_pSeekCursor->first();
{
if (m_pSeekCursor->isFirst())
bSuccess = sal_True;
else
bSuccess = m_pSeekCursor->first();
}
}
if (bSuccess)