diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 11:47:06 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 11:47:06 +0000 |
commit | 8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59 (patch) | |
tree | ca2b0cc4fba88107f5f6e740285184a061011866 /vcl/osx/a11yselectionwrapper.mm | |
parent | Adding debian version 4:24.2.3-2. (diff) | |
download | libreoffice-8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59.tar.xz libreoffice-8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59.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; |