From 1661ca09a398504cda0698f36a7228ba628afcc7 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 16 Sep 2024 10:55:10 +0100 Subject: [PATCH] wina11y: Drop unused CAccComponentBase::grabFocus Accessible's `IAccessibleComponent` interface [1] has no `grabFocus` method and `CAccComponentBase::grabFocus`. Therefore, drop it. The `IAccessible` interface has an `IAccessible::accSelect` method that can be used to request focus by passing the `SELFLAG_TAKEFOCUS` flag [3], but that is implemented in `CMAccessible::accSelect`. [1] https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/interface_i_accessible_component.html#a8709fdbf3f51ae079af274854a8bffd4 [2] https://learn.microsoft.com/en-us/windows/win32/api/oleacc/nf-oleacc-iaccessible-accselect [3] https://learn.microsoft.com/en-us/windows/win32/winauto/selflag Change-Id: I1ae99fdbf60aa18a041c086a73f9bd7c6a80cace Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173439 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- .../source/UAccCOM/AccComponentBase.cxx | 29 ------------------- .../source/UAccCOM/AccComponentBase.h | 3 -- 2 files changed, 32 deletions(-) diff --git a/winaccessibility/source/UAccCOM/AccComponentBase.cxx b/winaccessibility/source/UAccCOM/AccComponentBase.cxx index 91a9219b3ef0..27f8354d43de 100644 --- a/winaccessibility/source/UAccCOM/AccComponentBase.cxx +++ b/winaccessibility/source/UAccCOM/AccComponentBase.cxx @@ -62,35 +62,6 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccComponentBase::get_locationInParent(long* } } -/** - * Grabs the focus to this object. - * - * @param success the boolean result to be returned. - */ -COM_DECLSPEC_NOTHROW STDMETHODIMP CAccComponentBase::grabFocus(boolean* success) -{ - SolarMutexGuard g; - - try - { - if (success == nullptr) - return E_INVALIDARG; - - if (!pRXComp.is()) - { - return E_FAIL; - } - GetXInterface()->grabFocus(); - *success = TRUE; - - return S_OK; - } - catch (...) - { - return E_FAIL; - } -} - /** * Returns the foreground color of this object. * diff --git a/winaccessibility/source/UAccCOM/AccComponentBase.h b/winaccessibility/source/UAccCOM/AccComponentBase.h index 01649a11aeb8..89c50c46c63f 100644 --- a/winaccessibility/source/UAccCOM/AccComponentBase.h +++ b/winaccessibility/source/UAccCOM/AccComponentBase.h @@ -38,9 +38,6 @@ public: // box relative to the parent. STDMETHOD(get_locationInParent)(long* x, long* y); - // Grabs the focus to this object. - STDMETHOD(grabFocus)(boolean* success); - // Returns the foreground color of this object. STDMETHOD(get_foreground)(IA2Color* foreground);