diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-22 16:57:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-22 22:16:27 +0200 |
commit | 2943666a7737d57e4307a24e08b8fd000f50e6d1 (patch) | |
tree | de3c2d4be7fcf6f6cd8f7906a716195cbe4c7ce2 /svx | |
parent | a9d797ed771632afafb702697a6f31e0c25e80cf (diff) |
let up/down increase/decrease record number
Change-Id: I4d77cf71640922db5865586a0d053a46834f4b0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99245
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/form/tbxform.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx index dadbb362076f..26ff4ad7a0cf 100644 --- a/svx/source/form/tbxform.cxx +++ b/svx/source/form/tbxform.cxx @@ -88,6 +88,23 @@ IMPL_LINK_NOARG(SvxFmAbsRecWin, FocusOutHdl, weld::Widget&, void) IMPL_LINK(SvxFmAbsRecWin, KeyInputHdl, const KeyEvent&, rKEvt, bool) { + vcl::KeyCode aCode = rKEvt.GetKeyCode(); + bool bUp = (aCode.GetCode() == KEY_UP); + bool bDown = (aCode.GetCode() == KEY_DOWN); + + if (!aCode.IsShift() && !aCode.IsMod1() && !aCode.IsMod2() && (bUp || bDown)) + { + sal_Int64 nRecord = m_xWidget->get_text().toInt64(); + if (bUp) + ++nRecord; + else + --nRecord; + if (nRecord < 1) + nRecord = 1; + m_xWidget->set_text(OUString::number(nRecord)); + return true; + } + return ChildKeyInput(rKEvt); } |