diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 11:48:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 11:48:25 +0000 |
commit | 9c0049cfae49c8e4ddef9125a69db2ad134c10c6 (patch) | |
tree | 812a86c0eee63dfc5ace12f2622ed3ce9cd3d680 /vcl/osx/a11yselectionwrapper.mm | |
parent | Releasing progress-linux version 4:24.2.3-2~progress7.99u1. (diff) | |
download | libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.tar.xz libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.zip |
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vcl/osx/a11yselectionwrapper.mm')
-rw-r--r-- | vcl/osx/a11yselectionwrapper.mm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/vcl/osx/a11yselectionwrapper.mm b/vcl/osx/a11yselectionwrapper.mm index 9d3beee2d3..4c9d1c7bfc 100644 --- a/vcl/osx/a11yselectionwrapper.mm +++ b/vcl/osx/a11yselectionwrapper.mm @@ -34,10 +34,13 @@ using namespace ::com::sun::star::uno; Reference< XAccessibleSelection > xAccessibleSelection = [ wrapper accessibleSelection ]; if( xAccessibleSelection.is() ) { - NSMutableArray * children = [ [ NSMutableArray alloc ] init ]; try { sal_Int64 n = xAccessibleSelection -> getSelectedAccessibleChildCount(); + // Related tdf#158914: implicitly call autorelease selector + // Callers expect this selector to return an autoreleased object. + NSMutableArray * children = [ NSMutableArray arrayWithCapacity: n ]; + // Fix hanging when selecting a column or row in Calc // When a Calc column is selected, the child count will be // at least a million. Constructing that many C++ Calc objects @@ -49,7 +52,12 @@ using namespace ::com::sun::star::uno; n = MAXIMUM_ACCESSIBLE_TABLE_CELLS; for ( sal_Int64 i=0 ; i < n ; ++i ) { - [ children addObject: [ AquaA11yFactory wrapperForAccessible: xAccessibleSelection -> getSelectedAccessibleChild( i ) ] ]; + // Related tdf#158914: explicitly call release selector + // [ AquaA11yFactory wrapperForAccessible: ] is not a getter. + // It expects the caller to release the returned object. + id child_wrapper = [ AquaA11yFactory wrapperForAccessible: xAccessibleSelection -> getSelectedAccessibleChild( i ) ]; + [ children addObject: child_wrapper ]; + [ child_wrapper release ]; } return children; |