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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 2 08:46:20 UTC 2020


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

New commits:
commit 475f5cebe3f98f2247c6ad5ab55f60c40efe1c7b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Dec 1 15:52:31 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Dec 2 09:45:41 2020 +0100

    tdf#138427 focus set to wrong input box
    
    Change-Id: I4c1d3aa720f280f0ec1a3764d55f1d95ebd3180d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106950
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx
index 68d1ec3b4fc4..f64b6aff9bd5 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