summaryrefslogtreecommitdiffstats
path: root/vcl/osx/a11ytextattributeswrapper.mm
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/osx/a11ytextattributeswrapper.mm')
-rw-r--r--vcl/osx/a11ytextattributeswrapper.mm12
1 files changed, 9 insertions, 3 deletions
diff --git a/vcl/osx/a11ytextattributeswrapper.mm b/vcl/osx/a11ytextattributeswrapper.mm
index 4404dc6463..11b205a803 100644
--- a/vcl/osx/a11ytextattributeswrapper.mm
+++ b/vcl/osx/a11ytextattributeswrapper.mm
@@ -210,7 +210,10 @@ using namespace ::com::sun::star::uno;
} else if ( property.Name == "CharFontName" ) {
OUString fontname;
property.Value >>= fontname;
- [fontDescriptor setName:CreateNSString(fontname)];
+ // Related tdf#158914: explicitly call autorelease selector
+ // CreateNSString() is not a getter. It expects the caller to
+ // release the returned string.
+ [ fontDescriptor setName: [ CreateNSString(fontname) autorelease ] ];
} else if ( property.Name == "CharWeight" ) {
[fontDescriptor setBold:[AquaA11yTextAttributesWrapper convertBoldStyle:property]];
} else if ( property.Name == "CharPosture" ) {
@@ -313,8 +316,11 @@ using namespace ::com::sun::star::uno;
int endIndex = loc + len;
int currentIndex = loc;
try {
- NSString * myString = CreateNSString ( [ wrapper accessibleText ] -> getText() ); // TODO: dirty fix for i87817
- string = [ [ NSMutableAttributedString alloc ] initWithString: CreateNSString ( [ wrapper accessibleText ] -> getTextRange ( loc, loc + len ) ) ];
+ // Related tdf#158914: explicitly call autorelease selector
+ // CreateNSString() is not a getter. It expects the caller to
+ // release the returned string.
+ NSString * myString = [ CreateNSString ( [ wrapper accessibleText ] -> getText() ) autorelease ]; // TODO: dirty fix for i87817
+ string = [ [ NSMutableAttributedString alloc ] initWithString: [ CreateNSString ( [ wrapper accessibleText ] -> getTextRange ( loc, loc + len ) ) autorelease ] ];
[ string autorelease ];
if ( [ wrapper accessibleTextAttributes ] && [myString characterAtIndex:0] != 57361) { // TODO: dirty fix for i87817
[ string beginEditing ];