Remove remaining bogus use of objc_msgSend()
Follow-up to 5bf61e98b0.
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>
This commit is contained in:
committed by
Tor Lillqvist
parent
5bf61e98b0
commit
ecb916667b
@@ -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;
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -146,7 +146,7 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper< css::util::XStrin
|
||||
|
||||
}
|
||||
|
||||
@interface RecentMenuDelegate : NSObject
|
||||
@interface RecentMenuDelegate : NSObject <NSMenuDelegate>
|
||||
{
|
||||
std::vector< RecentMenuEntry >* m_pRecentFilesItems;
|
||||
}
|
||||
@@ -347,16 +347,7 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const OUStri
|
||||
[pItem setEnabled: YES];
|
||||
NSMenu* pRecentMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( i_rTitle ) ];
|
||||
|
||||
// When compiling against 10.6 SDK, we get the warning:
|
||||
// class 'RecentMenuDelegate' does not implement the 'NSMenuDelegate' protocol
|
||||
|
||||
// No idea if that is a bogus warning, or if the way this is
|
||||
// implemented just is so weird that the compiler gets
|
||||
// confused. Anyway, to avoid warnings, instead of this:
|
||||
// [pRecentMenu setDelegate: pRecentDelegate];
|
||||
// do this:
|
||||
reinterpret_cast<id (*)(id, SEL, ...)>(objc_msgSend)(
|
||||
pRecentMenu, @selector(setDelegate:), pRecentDelegate);
|
||||
[pRecentMenu setDelegate: pRecentDelegate];
|
||||
|
||||
[pRecentMenu setAutoenablesItems: NO];
|
||||
[pItem setSubmenu: pRecentMenu];
|
||||
@@ -371,10 +362,7 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const OUStri
|
||||
[pItem setEnabled: YES];
|
||||
pRecentMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( i_rTitle ) ];
|
||||
|
||||
// See above
|
||||
// [pRecentMenu setDelegate: pRecentDelegate];
|
||||
reinterpret_cast<id (*)(id, SEL, ...)>(objc_msgSend)(
|
||||
pRecentMenu, @selector(setDelegate:), pRecentDelegate);
|
||||
[pRecentMenu setDelegate: pRecentDelegate];
|
||||
|
||||
[pRecentMenu setAutoenablesItems: NO];
|
||||
[pItem setSubmenu: pRecentMenu];
|
||||
|
||||
Reference in New Issue
Block a user