summaryrefslogtreecommitdiff
path: root/winaccessibility
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-10-20 12:56:39 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2023-10-21 13:48:50 +0200
commita8e75a8ac93c18a7e955e448bfd120d0ed9ef0b0 (patch)
tree57b4f3e264ab021115170ca9927e22d7330a95b2 /winaccessibility
parenteff3e9b8a576863c01f4244a5628cda64f48a363 (diff)
wina11y: Just return empty attr string when none present
If the `XAccessibleExtendedAttributes` interface isn't implemented, just return an empty string for the attributes instead of an error code. (This seems like a totally valid case to me, no need to report an error.) Change-Id: I986f030bc7a01da0fdd92a5aa2b4cf3c0d6a9200 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158258 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'winaccessibility')
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 98f15fdf230b..30e9b043b0fb 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -2721,10 +2721,10 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *p
{
return E_FAIL;
}
+
+ OUString sAttributes;
Reference<XAccessibleExtendedAttributes> pRXI(pRContext,UNO_QUERY);
- if( !pRXI.is() )
- return E_FAIL;
- else
+ if (pRXI.is())
{
css::uno::Reference<css::accessibility::XAccessibleExtendedAttributes> pRXAttr;
pRXAttr = pRXI.get();
@@ -2732,13 +2732,14 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *p
OUString val;
anyVal >>= val;
+ sAttributes += val;
+ }
- if(*pAttr)
- SysFreeString(*pAttr);
- *pAttr = SysAllocString(o3tl::toW(val.getStr()));
+ if (*pAttr)
+ SysFreeString(*pAttr);
+ *pAttr = SysAllocString(o3tl::toW(sAttributes.getStr()));
- return S_OK;
- }
+ return S_OK;
} catch(...) { return E_FAIL; }
}