diff options
author | Patrick Luby <plubius@neooffice.org> | 2023-05-28 17:37:46 -0300 |
---|---|---|
committer | Patrick Luby <plubius@neooffice.org> | 2023-05-29 00:24:26 +0200 |
commit | 1bf7da609848652ad99d9bde844b90d37de80ffa (patch) | |
tree | acc310193e8c88ce8a578f58954ed67d876dba77 /vcl | |
parent | de6c3385d4cd515862804a9d566e8fded39147e8 (diff) |
Partial fix tdf#146626 Catch uncaught DisposedException
Fix crash due to an uncaught DisposedException thrown by
SwAccessibleParagraph::getTextRange() by using the same try/catch
block in -[A11yWrapper accessibilityAttributeValue:] in
-[A11yWrapper accessibilityAttributeValue:forParameter].
Change-Id: Ifcaec3eb2d76f32bddc56a1242f6d86f8b90f782
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152361
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
(cherry picked from commit f8cc6f960e8aeb37547d447fed2b2c6e6ddc02e3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152317
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/osx/a11ywrapper.mm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm index c4beeb5b0567..cb6fca0a9e29 100644 --- a/vcl/osx/a11ywrapper.mm +++ b/vcl/osx/a11ywrapper.mm @@ -870,7 +870,15 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { SAL_INFO("vcl.a11y", "[" << self << " accessibilityAttributeValue:" << attribute << " forParameter:" << (static_cast<NSObject*>(parameter)) << "]"); SEL methodSelector = [ self selectorForAttribute: attribute asGetter: YES withGetterParameter: YES ]; if ( [ self respondsToSelector: methodSelector ] ) { - return [ self performSelector: methodSelector withObject: parameter ]; + try { + return [ self performSelector: methodSelector withObject: parameter ]; + } catch ( const DisposedException & ) { + mIsTableCell = NO; // just to be sure + [ AquaA11yFactory removeFromWrapperRepositoryFor: [ self accessibleContext ] ]; + return nil; + } catch ( const Exception & ) { + // empty + } } return nil; // TODO: to be completed } |