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:30:01 +0100
commitecb916667b633f8647790e040226b093760e6cfe (patch)
treeb372198368cefcc798c991a8656a0f14e2419c53 /sfx2
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 'sfx2')
-rw-r--r--sfx2/source/appl/shutdowniconaqua.mm18
1 files changed, 3 insertions, 15 deletions
diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index dc824e91d92d..9d788db1abe7 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -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];