[Libreoffice-commits] core.git: include/vcl sc/source svx/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Oct 22 19:41:31 UTC 2020
include/vcl/customweld.hxx | 7 ++++++-
sc/source/ui/app/inputwin.cxx | 1 -
svx/source/dialog/weldeditview.cxx | 3 ---
3 files changed, 6 insertions(+), 5 deletions(-)
New commits:
commit d7c8799c14e16060a834dcaf50aa962a27d31314
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Oct 20 10:55:33 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Oct 22 21:40:44 2020 +0200
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 at redhat.com>
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);
}
More information about the Libreoffice-commits
mailing list