[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - formula/source include/formula

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 2 10:23:45 UTC 2020


 formula/source/ui/dlg/funcutl.cxx |    8 ++++++++
 include/formula/funcutl.hxx       |    5 +----
 2 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit b0bc1899fc2cb93f8c4a7b52ffaee379d5fbbd8f
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Dec 1 15:52:31 2020 +0000
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Wed Dec 2 11:23:04 2020 +0100

    tdf#138427 focus set to wrong input box
    
    Change-Id: I4c1d3aa720f280f0ec1a3764d55f1d95ebd3180d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106951
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx
index 2cfc7deccec6..41dc1788e03d 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -350,6 +350,14 @@ bool RefEdit::KeyInput(const KeyEvent& rKEvt)
     return false;
 }
 
+void RefEdit::GrabFocus()
+{
+    bool bHadFocus = xEntry->has_focus();
+    xEntry->grab_focus();
+    if (!bHadFocus && xEntry->has_focus())
+        GetFocus(*xEntry);
+}
+
 IMPL_LINK_NOARG(RefEdit, GetFocus, weld::Widget&, void)
 {
     maGetFocusHdl.Call(*this);
diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx
index 02cf585a771e..0a14e62db159 100644
--- a/include/formula/funcutl.hxx
+++ b/include/formula/funcutl.hxx
@@ -84,10 +84,7 @@ public:
         Modify(*xEntry);
     }
 
-    void GrabFocus()
-    {
-        xEntry->grab_focus();
-    }
+    void GrabFocus();
 
     void SelectAll()
     {


More information about the Libreoffice-commits mailing list