summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2011-09-28 23:46:17 +0300
committerTor Lillqvist <tml@iki.fi>2011-09-28 23:50:11 +0300
commit1db86ebf0dffe41c25d2d6e803e443daf6a32572 (patch)
treec5b4a3fa70399d2b7b7b006163133863f1fd9dee /sfx2
parentcf7c983126b469568792e40aabf44f161a04f266 (diff)
WaE: class 'RecentMenuDelegate' does not implement the 'NSMenuDelegate' protocol
Diffstat (limited to 'sfx2')
-rwxr-xr-xsfx2/source/appl/shutdowniconaqua.mm19
1 files changed, 17 insertions, 2 deletions
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 <vector>
#include "premac.h"
+#include <objc/objc-runtime.h>
#include <Cocoa/Cocoa.h>
#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];
}