summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2020-12-05 18:16:37 +0200
committerTor Lillqvist <tml@collabora.com>2020-12-05 20:30:01 +0100
commitecb916667b633f8647790e040226b093760e6cfe (patch)
treeb372198368cefcc798c991a8656a0f14e2419c53 /extensions
parent5bf61e98b0746a4afeb68a80e54b4eb4bf4ea89f (diff)
Remove remaining bogus use of objc_msgSend()
Follow-up to 5bf61e98b0746a4afeb68a80e54b4eb4bf4ea89f. Should avoid crashes when running as arm64 code on macOS on arm64. Change-Id: Id05d182684df82c8a7bf09f6bb7e8ccb01997b62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107259 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/macosx/spotlight/OOoContentDataParser.h2
-rw-r--r--extensions/source/macosx/spotlight/OOoContentDataParser.m7
-rw-r--r--extensions/source/macosx/spotlight/OOoMetaDataParser.h2
-rw-r--r--extensions/source/macosx/spotlight/OOoMetaDataParser.m6
4 files changed, 4 insertions, 13 deletions
diff --git a/extensions/source/macosx/spotlight/OOoContentDataParser.h b/extensions/source/macosx/spotlight/OOoContentDataParser.h
index 7112497cf7de..dc07a3166122 100644
--- a/extensions/source/macosx/spotlight/OOoContentDataParser.h
+++ b/extensions/source/macosx/spotlight/OOoContentDataParser.h
@@ -19,7 +19,7 @@
#import <Cocoa/Cocoa.h>
-@interface OOoContentDataParser : NSObject {
+@interface OOoContentDataParser : NSObject <NSXMLParserDelegate> {
// indicates if we are interested in an element's content
BOOL shouldReadCharacters;
diff --git a/extensions/source/macosx/spotlight/OOoContentDataParser.m b/extensions/source/macosx/spotlight/OOoContentDataParser.m
index d3ecf16ffaab..e1f51e5b90c7 100644
--- a/extensions/source/macosx/spotlight/OOoContentDataParser.m
+++ b/extensions/source/macosx/spotlight/OOoContentDataParser.m
@@ -47,12 +47,7 @@
NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data];
- // Once again...
- // class 'OOoContentDataParser' does not implement the 'NSXMLParserDelegate' protocol
- // So instead of this:
- // [parser setDelegate:self];
- // do this:
- ((id (*)(id, SEL, ...))objc_msgSend)(parser, @selector(setDelegate:), self);
+ [parser setDelegate:self];
[parser setShouldResolveExternalEntities:NO];
[parser parse];
diff --git a/extensions/source/macosx/spotlight/OOoMetaDataParser.h b/extensions/source/macosx/spotlight/OOoMetaDataParser.h
index 5db7634cce0c..85d48b1735d7 100644
--- a/extensions/source/macosx/spotlight/OOoMetaDataParser.h
+++ b/extensions/source/macosx/spotlight/OOoMetaDataParser.h
@@ -20,7 +20,7 @@
#import <Cocoa/Cocoa.h>
-@interface OOoMetaDataParser : NSObject {
+@interface OOoMetaDataParser : NSObject <NSXMLParserDelegate> {
//indicates if content should be read
BOOL shouldReadCharacters;
//indicates if the current element is a custom metadata tag
diff --git a/extensions/source/macosx/spotlight/OOoMetaDataParser.m b/extensions/source/macosx/spotlight/OOoMetaDataParser.m
index 2b4dac82c555..1e7cac685b88 100644
--- a/extensions/source/macosx/spotlight/OOoMetaDataParser.m
+++ b/extensions/source/macosx/spotlight/OOoMetaDataParser.m
@@ -91,11 +91,7 @@ static NSDictionary *metaXML2MDIKeys;
NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data];
- // class 'OOoMetaDataParser' does not implement the 'NSXMLParserDelegate' protocol
- // So instead of this:
- // [parser setDelegate:self];
- // do this:
- ((id (*)(id, SEL, ...))objc_msgSend)(parser, @selector(setDelegate:), self);
+ [parser setDelegate:self];
[parser setShouldResolveExternalEntities:NO];
[parser parse];