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@ubuntu.com>
diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx
index 2cfc7de..41dc178 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 02cf585..0a14e62 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()
    {