summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorPatrick Luby <plubius@neooffice.org>2023-05-28 17:37:46 -0300
committerAndras Timar <andras.timar@collabora.com>2023-06-04 16:34:07 +0200
commitd46fb53ebca9a567181764388c4df810edf912cd (patch)
tree79edf9348dff94a2c7cec567558873d45435fa7d /vcl
parenta8c696d9dd6b8573f755b46b1bc6f5cf3950daca (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>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/osx/a11ywrapper.mm10
1 files changed, 9 insertions, 1 deletions
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 7cd6b70cc1f4..96de29e07f77 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
}