diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-20 10:55:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-22 21:40:44 +0200 |
commit | d7c8799c14e16060a834dcaf50aa962a27d31314 (patch) | |
tree | 68e70a4a1a85e73d63891ce0576a9b331ca2f1ab | |
parent | cfadad134c6ab00a406a527e838d2e4940d337eb (diff) |
always call GetFocus if GrabFocus succeeded
so the CustomWidgetController can replace vcl::Control more
seamlessly
Change-Id: I3c2ff9c45ff0dc55b09863611df2a7d941d1c534
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104574
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/vcl/customweld.hxx | 7 | ||||
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 1 | ||||
-rw-r--r-- | svx/source/dialog/weldeditview.cxx | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx index 64f980732dfb..df7b97e070d7 100644 --- a/include/vcl/customweld.hxx +++ b/include/vcl/customweld.hxx @@ -63,7 +63,12 @@ public: } virtual void Show() { m_pDrawingArea->show(); } virtual void Hide() { m_pDrawingArea->hide(); } - void GrabFocus() { m_pDrawingArea->grab_focus(); } + void GrabFocus() + { + m_pDrawingArea->grab_focus(); + if (m_pDrawingArea->has_focus()) + GetFocus(); + } bool HasFocus() const { return m_pDrawingArea->has_focus(); } bool IsVisible() const { return m_pDrawingArea->get_visible(); } bool IsReallyVisible() const { return m_pDrawingArea->is_visible(); } diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 311611678148..1632ce1f3e09 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -2051,7 +2051,6 @@ void ScTextWnd::StyleUpdated() void ScTextWnd::TextGrabFocus() { GrabFocus(); - GetFocus(); } // Position window diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx index 9bf6f599c857..1031385282e5 100644 --- a/svx/source/dialog/weldeditview.cxx +++ b/svx/source/dialog/weldeditview.cxx @@ -137,10 +137,7 @@ bool WeldEditView::MouseButtonDown(const MouseEvent& rMEvt) CaptureMouse(); if (!HasFocus()) - { GrabFocus(); - GetFocus(); - } return m_xEditView && m_xEditView->MouseButtonDown(rMEvt); } |