diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2012-12-06 13:22:55 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2012-12-06 19:39:09 +0100 |
commit | 33af123fa0798eceaac6243111d57c7662a24c6c (patch) | |
tree | 70ad2c7d75fde5720e5308ece8ed06dce127141d /svx/source/fmcomp | |
parent | dbafb1663e124cc9d440f4941147a14ae37ab63d (diff) |
Avoid seeking a cursor to where it already is
Change-Id: I817aef57f3e028d77cf13f8cca1ecc7afcea9725
Diffstat (limited to 'svx/source/fmcomp')
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 5e129e1c6b8e..9a4081656770 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -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) |