diff options
author | Tor Lillqvist <tml@iki.fi> | 2011-09-28 17:19:40 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2011-09-28 17:43:39 +0300 |
commit | bbec6182140209774390a6adda967e94f14b9c95 (patch) | |
tree | 2a92bdb7bf25ea3f8dd6b23e31040c5b5ee0f9e8 /vcl | |
parent | WaE: suggest a space before ';' or explicit braces around empty body in 'whil... (diff) | |
download | core-bbec6182140209774390a6adda967e94f14b9c95.tar.gz core-bbec6182140209774390a6adda967e94f14b9c95.zip |
WaE: foo does not implement the fooDelegate protocol
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/aqua/source/window/salframe.cxx | 13 | ||||
-rw-r--r-- | vcl/aqua/source/window/salmenu.cxx | 12 |
2 files changed, 23 insertions, 2 deletions
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index 56eff66d945a..5ac2842cb469 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -51,6 +51,7 @@ #include "salwtype.hxx" #include "premac.h" +#include <objc/objc-runtime.h> // needed for theming // FIXME: move theming code to salnativewidgets.cxx #include <Carbon/Carbon.h> @@ -212,7 +213,17 @@ void AquaSalFrame::initWindowAndView() else [mpWindow setAcceptsMouseMovedEvents: YES]; [mpWindow setHasShadow: YES]; - [mpWindow setDelegate: mpWindow]; + + // WTF? With the 10.6 SDK and gcc 4.2.1, we get: class 'NSWindow' + // does not implement the 'NSWindowDelegate' protocol. Anyway, + // having the window object be its own delegate object is + // apparently what the code does on purpose, see discussion in + // https://issues.apache.org/ooo/show_bug.cgi?id=91990 + + // So to silence the warning when compiling with -Werror, instead of: + // [mpWindow setDelegate: mpWindow]; + // do this: + objc_msgSend(mpWindow, @selector(setDelegate:), mpWindow); NSRect aRect = { { 0,0 }, { maGeometry.nWidth, maGeometry.nHeight } }; mnTrackingRectTag = [mpView addTrackingRect: aRect owner: mpView userData: nil assumeInside: NO]; diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx index ef76f4cf6e61..d719ec5405b4 100644 --- a/vcl/aqua/source/window/salmenu.cxx +++ b/vcl/aqua/source/window/salmenu.cxx @@ -44,6 +44,8 @@ #include "svids.hrc" #include "window.h" +#include <objc/objc-runtime.h> + const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL; @interface MainMenuSelector : NSObject @@ -260,7 +262,15 @@ AquaSalMenu::AquaSalMenu( bool bMenuBar ) : if( ! mbMenuBar ) { mpMenu = [[SalNSMenu alloc] initWithMenu: this]; - [mpMenu setDelegate: mpMenu]; + // With the 10.6 SDK and gcc 4.2.1, we get: class 'NSMenu' + // does not implement the 'NSMenuDelegate' protocol. Anyway, + // having the menu object be its own delegate object is + // apparently what the code does on purpose. + + // So to silcense the warning, instead of: + // [mpMenu setDelegate: mpMenu]; + // do this: + objc_msgSend(mpMenu, @selector(setDelegate:), mpMenu); } else { |