diff --git a/ChangeLog b/ChangeLog index 88d29aecb..b85a8055e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-12-31 Fred Kiefer + + * Source/NSMenu.m + * Source/NSPopUpButton.m, + * Source/NSTextView.m, + * Source/GSNibLoading.m: Add type casts to keep compiler happy. + 2008-12-31 Fred Kiefer * Headers/Additions/GNUstepGUI/GSLayoutManager.h: Add some 10.5 methods. diff --git a/Source/GSNibLoading.m b/Source/GSNibLoading.m index b9d8ab29b..e9ea6249a 100644 --- a/Source/GSNibLoading.m +++ b/Source/GSNibLoading.m @@ -95,11 +95,14 @@ static BOOL _isInInterfaceBuilder = NO; @end @interface NSMenu (NibCompatibility) -- (void) _setGeometry; - (void) _setMain: (BOOL)isMain; @end +@interface NSMenu (GNUstepPrivate) +- (void) _setGeometry; +@end @implementation NSMenu (NibCompatibility) +// FIXME: Why can't this be merged with setMain: ? - (void) _setMain: (BOOL)isMain { if (isMain) @@ -107,13 +110,11 @@ static BOOL _isInInterfaceBuilder = NO; NSMenuView *oldRep; NSInterfaceStyle oldStyle; NSInterfaceStyle newStyle; - NSMenuItem *appItem; NSString *processName; if([self numberOfItems] == 0) - return; + return; - appItem = [self itemAtIndex: 0]; // Info item. oldRep = [self menuRepresentation]; oldStyle = [oldRep interfaceStyle]; newStyle = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); @@ -146,19 +147,22 @@ static BOOL _isInInterfaceBuilder = NO; // if it's a standard menu, transform it to be more NeXT'ish/GNUstep-like if(_menu.horizontal == NO) - { - NSString *infoString = NSLocalizedString (@"Info", @"Info"); - NSString *quitString = [NSString stringWithFormat: @"%@ %@", - NSLocalizedString (@"Quit", @"Quit"), processName]; - NSMenuItem *quitItem = [[NSMenuItem alloc] initWithTitle: quitString - action: @selector(terminate:) - keyEquivalent: @"q"]; + { + NSString *infoString = NSLocalizedString (@"Info", @"Info"); + NSString *quitString = [NSString stringWithFormat: @"%@ %@", + NSLocalizedString (@"Quit", @"Quit"), processName]; + NSMenuItem *quitItem = [[NSMenuItem alloc] initWithTitle: quitString + action: @selector(terminate:) + keyEquivalent: @"q"]; + NSMenuItem *appItem; + + appItem = (NSMenuItem*)[self itemAtIndex: 0]; // Info item. - [self addItem: quitItem]; - [self setTitle: processName]; - [appItem setTitle: infoString]; - [[appItem submenu] setTitle: infoString]; - } + [self addItem: quitItem]; + [self setTitle: processName]; + [appItem setTitle: infoString]; + [[appItem submenu] setTitle: infoString]; + } [self _setGeometry]; [self sizeToFit]; diff --git a/Source/NSMenu.m b/Source/NSMenu.m index 56cb970a6..a3cd4bb89 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -975,7 +975,7 @@ static BOOL menuBarVisible = YES; while (cont && i < num) { cont = [_delegate menu: self - updateItem: [self itemAtIndex: i] + updateItem: (NSMenuItem*)[self itemAtIndex: i] atIndex: i shouldCancel: NO]; i++; diff --git a/Source/NSPopUpButton.m b/Source/NSPopUpButton.m index 8c69837eb..104b85b80 100644 --- a/Source/NSPopUpButton.m +++ b/Source/NSPopUpButton.m @@ -417,7 +417,7 @@ this to return nil to indicate that we have no context menu. - (BOOL) performKeyEquivalent: (NSEvent*)theEvent { NSMenu *m = [self menu]; - NSMenuItem *oldSelectedItem = [_cell selectedItem]; + NSMenuItem *oldSelectedItem = (NSMenuItem *)[_cell selectedItem]; if (m != nil) { diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 385f2cb90..6f94ae1dc 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -5313,7 +5313,8 @@ configuation! */ NSTextView *tv = [self _bestTextViewForUndo]; if ([tv shouldChangeTextInRange: undoRange - replacementString: undoString ? [undoString string] : @""]) + replacementString: undoString ? (NSString*)[undoString string] : + (NSString*)@""]) { [tv replaceCharactersInRange: undoRange withAttributedString: undoString];