From 1db86ebf0dffe41c25d2d6e803e443daf6a32572 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 28 Sep 2011 23:46:17 +0300 Subject: WaE: class 'RecentMenuDelegate' does not implement the 'NSMenuDelegate' protocol --- sfx2/source/appl/shutdowniconaqua.mm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index 481447fe7f1a..8cb96b1f549b 100755 --- a/sfx2/source/appl/shutdowniconaqua.mm +++ b/sfx2/source/appl/shutdowniconaqua.mm @@ -49,6 +49,7 @@ #include #include "premac.h" +#include #include #include "postmac.h" @@ -362,7 +363,17 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const String ]; [pItem setEnabled: YES]; NSMenu* pRecentMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( i_rTitle ) ]; - [pRecentMenu setDelegate: pRecentDelegate]; + + // 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: + objc_msgSend(pRecentMenu, @selector(setDelegate:), pRecentDelegate); + [pRecentMenu setAutoenablesItems: NO]; [pItem setSubmenu: pRecentMenu]; @@ -375,7 +386,11 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const String ]; [pItem setEnabled: YES]; pRecentMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( i_rTitle ) ]; - [pRecentMenu setDelegate: pRecentDelegate]; + + // See above + // [pRecentMenu setDelegate: pRecentDelegate]; + objc_msgSend(pRecentDelegate, @selector(setDelegate:), pRecentDelegate); + [pRecentMenu setAutoenablesItems: NO]; [pItem setSubmenu: pRecentMenu]; } -- cgit