[webkit-changes] cvs commit: WebKit/Carbon.subproj HIWebView.m
Tim
tomernic at opensource.apple.com
Fri Dec 9 18:13:14 PST 2005
tomernic 05/12/09 18:13:14
Modified: . ChangeLog
Carbon.subproj HIWebView.m
Log:
Reviewed by John Sullivan.
* Carbon.subproj/HIWebView.m:
(UpdateCommandStatus):
Don't call -performSelector:withObject: on a method that returns a BOOL; this is not guaranteed to work on all architectures.
-performSelector:withObject:'s return value should only be checked if the method returns an object.
Revision Changes Path
1.3394 +9 -0 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3393
retrieving revision 1.3394
diff -u -r1.3393 -r1.3394
--- ChangeLog 9 Dec 2005 18:59:36 -0000 1.3393
+++ ChangeLog 10 Dec 2005 02:13:02 -0000 1.3394
@@ -1,3 +1,12 @@
+2005-12-09 Tim Omernick <timo at apple.com>
+
+ Reviewed by John Sullivan.
+
+ * Carbon.subproj/HIWebView.m:
+ (UpdateCommandStatus):
+ Don't call -performSelector:withObject: on a method that returns a BOOL; this is not guaranteed to work on all architectures.
+ -performSelector:withObject:'s return value should only be checked if the method returns an object.
+
2005-12-09 Timothy Hatcher <timothy at apple.com>
Reviewed by nobody, build fix.
1.29 +6 -1 WebKit/Carbon.subproj/HIWebView.m
Index: HIWebView.m
===================================================================
RCS file: /cvs/root/WebKit/Carbon.subproj/HIWebView.m,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- HIWebView.m 5 Sep 2005 23:12:44 -0000 1.28
+++ HIWebView.m 10 Dec 2005 02:13:13 -0000 1.29
@@ -34,6 +34,8 @@
#include "HIViewAdapter.h"
#include <WebKitSystemInterface.h>
+#import <objc/objc-runtime.h>
+
@interface NSWindow (AppKitSecretsHIWebViewKnows)
- (void)_removeWindowRef;
@end
@@ -1186,7 +1188,10 @@
{
proxy = [[MenuItemProxy alloc] initWithAction: selector];
- if ( [resp performSelector:@selector(validateUserInterfaceItem:) withObject: proxy] )
+ // Can't use -performSelector:withObject: here because the method we're calling returns BOOL, while
+ // -performSelector:withObject:'s return value is assumed to be an id.
+ BOOL (*validationFunction)(id, SEL, id) = (BOOL (*)(id, SEL, id))objc_msgSend;
+ if (validationFunction(resp, @selector(validateUserInterfaceItem:), proxy))
EnableMenuItem( inCommand->menu.menuRef, inCommand->menu.menuItemIndex );
else
DisableMenuItem( inCommand->menu.menuRef, inCommand->menu.menuItemIndex );
More information about the webkit-changes
mailing list