diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-12-01 15:52:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-12-02 09:45:41 +0100 |
commit | 475f5cebe3f98f2247c6ad5ab55f60c40efe1c7b (patch) | |
tree | ac9d87a9affa6c6c1f2a9ac382cde03000006e60 | |
parent | tdf#138471 wrong adjustment used for spinbutton (diff) | |
download | core-475f5cebe3f98f2247c6ad5ab55f60c40efe1c7b.tar.gz core-475f5cebe3f98f2247c6ad5ab55f60c40efe1c7b.zip |
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@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | formula/source/ui/dlg/funcutl.cxx | 8 | ||||
-rw-r--r-- | include/formula/funcutl.hxx | 5 |
2 files changed, 9 insertions, 4 deletions
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() { |