Add type casts to keep compiler happy.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27481 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-12-31 16:49:46 +00:00
parent ae4c7503ac
commit 326aaadef2
5 changed files with 31 additions and 19 deletions

View file

@ -1,3 +1,10 @@
2008-12-31 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSMenu.m
* Source/NSPopUpButton.m,
* Source/NSTextView.m,
* Source/GSNibLoading.m: Add type casts to keep compiler happy.
2008-12-31 Fred Kiefer <FredKiefer@gmx.de>
* Headers/Additions/GNUstepGUI/GSLayoutManager.h: Add some 10.5 methods.

View file

@ -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];

View file

@ -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++;

View file

@ -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)
{

View file

@ -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];