[Libreoffice-commits] core.git: svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 22 20:17:13 UTC 2020


 svx/source/form/tbxform.cxx |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 2943666a7737d57e4307a24e08b8fd000f50e6d1
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jul 22 16:57:57 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jul 22 22:16:27 2020 +0200

    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 at redhat.com>

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);
 }
 


More information about the Libreoffice-commits mailing list