summaryrefslogtreecommitdiff
path: root/sfx2
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:49:41 +0100
commit63d6ba7df8b55d6673a23996bc67058bb94757c4 (patch)
tree1ad2cca35ca84d63cb076f9326b439dfe645e1ed /sfx2
parent46601c23ea8cdd772333d19a270ea6c380fc6e94 (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/+/107262 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/shutdowniconaqua.mm16
1 files changed, 3 insertions, 13 deletions
diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 7b6b543dd19b..1f0b2c2224f4 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -142,7 +142,7 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper< css::util::XStrin
}
};
-@interface RecentMenuDelegate : NSObject
+@interface RecentMenuDelegate : NSObject <NSMenuDelegate>
{
std::vector< RecentMenuEntry >* m_pRecentFilesItems;
}
@@ -343,15 +343,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:
- ((id (*)(id, SEL, ...))objc_msgSend)(pRecentMenu, @selector(setDelegate:), pRecentDelegate);
+ [pRecentMenu setDelegate: pRecentDelegate];
[pRecentMenu setAutoenablesItems: NO];
[pItem setSubmenu: pRecentMenu];
@@ -366,9 +358,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];
- ((id (*)(id, SEL, ...))objc_msgSend)(pRecentMenu, @selector(setDelegate:), pRecentDelegate);
+ [pRecentMenu setDelegate: pRecentDelegate];
[pRecentMenu setAutoenablesItems: NO];
[pItem setSubmenu: pRecentMenu];