source:
trunk/aux/cocotron/win32/cocotron/cocotron-r609.patch
@
12653
Last change on this file since 12653 was 12653, checked in by palter, 11 years ago | |
---|---|
File size: 4.6 KB |
-
Foundation/NSUserDefaults/NSUserDefaults.m
313 313 } 314 314 315 315 -(NSInteger)integerForKey:(NSString *)defaultName { 316 NSNumber *number=[self objectForKey:defaultName];316 id number=[self objectForKey:defaultName]; 317 317 318 return [number isKindOfClass:objc_lookUpClass("NSNumber")]?[number intValue]:0; 318 return [number isKindOfClass:objc_lookUpClass("NSString")]?[(NSString *)number intValue]: 319 ([number isKindOfClass:objc_lookUpClass("NSNumber")]?[(NSNumber *)number intValue]:0); 319 320 } 320 321 321 322 322 323 -(float)floatForKey:(NSString *)defaultName { 323 NSNumber *number=[self objectForKey:defaultName];324 id number=[self objectForKey:defaultName]; 324 325 325 return [number isKindOfClass:objc_lookUpClass("NSNumber")]?[number floatValue]:0.0f; 326 return [number isKindOfClass:objc_lookUpClass("NSString")]?[(NSString *)number floatValue]: 327 ([number isKindOfClass:objc_lookUpClass("NSNumber")]?[(NSNumber *)number floatValue]:0.0); 328 326 329 } 327 330 328 331 -(void)setObject:value forKey:(NSString *)key { … … 338 341 } 339 342 340 343 -(void)setInteger:(NSInteger)value forKey:(NSString *)defaultName { 341 [self setObject:[NSNumber numberWithInteger:value] forKey:defaultName];344 [self setObject:[NSString stringWithFormat: @"%d",value] forKey:defaultName]; 342 345 } 343 346 344 347 -(void)setFloat:(float)value forKey:(NSString *)defaultName { 345 [self setObject:[NSNumber numberWithFloat:value] forKey:defaultName];348 [self setObject:[NSString stringWithFormat: @"%f",value] forKey:defaultName]; 346 349 } 347 350 348 351 -(void)removeObjectForKey:(NSString *)key { -
AppKit/NSApplication.h
9 9 #import <AppKit/NSResponder.h> 10 10 #import <AppKit/AppKitExport.h> 11 11 #import <AppKit/NSGraphics.h> 12 #import <AppKit/NSWindow.h> 12 13 13 @class NSWindow,NSImage,NSMenu, NSPasteboard, NSDisplay ;14 @class NSWindow,NSImage,NSMenu, NSPasteboard, NSDisplay, NSWindowController, NSDocument; 14 15 15 16 APPKIT_EXPORT NSString *NSModalPanelRunLoopMode; 16 17 APPKIT_EXPORT NSString *NSEventTrackingRunLoopMode; … … 209 210 @end 210 211 211 212 @interface NSObject(NSApplication_serviceRequest) 213 212 214 -(BOOL)writeSelectionToPasteboard:(NSPasteboard *)pasteboard types:(NSArray *)types; 213 215 @end 214 216 -
AppKit/NSApplication.m
29 29 #import <AppKit/CGWindow.h> 30 30 #import <AppKit/NSRaise.h> 31 31 #import <objc/message.h> 32 #import <AppKit/NSWindow.h> 32 33 33 34 NSString *NSModalPanelRunLoopMode=@"NSModalPanelRunLoopMode"; 34 35 NSString *NSEventTrackingRunLoopMode=@"NSEventTrackingRunLoopMode"; … … 413 414 needsUntitled = [_delegate applicationShouldOpenUntitledFile: self]; 414 415 } 415 416 417 if(needsUntitled && _delegate && [_delegate respondsToSelector: @selector(applicationOpenUntitledFile:)]) { 418 needsUntitled = ![_delegate applicationOpenUntitledFile: self]; 419 } 420 421 416 422 if(needsUntitled && controller && ![controller documentClassForType:[controller defaultType]]) { 417 423 needsUntitled = NO; 418 424 } … … 466 472 } 467 473 468 474 -(void)run { 469 470 NSAutoreleasePool *pool=[NSAutoreleasePool new]; 471 [self finishLaunching]; 472 [pool release]; 475 static BOOL didlaunch = NO; 476 NSAutoreleasePool *pool; 477 478 _isRunning=YES; 479 480 if (!didlaunch) { 481 didlaunch = YES; 482 pool=[NSAutoreleasePool new]; 483 [self finishLaunching]; 484 [pool release]; 485 } 473 486 474 _isRunning=YES;475 487 476 488 do { 477 489 pool = [NSAutoreleasePool new]; -
AppKit/NSDocument.m
21 21 22 22 @implementation NSDocument 23 23 24 static int untitled_document_number = 0; 25 24 26 +(NSArray *)readableTypes { 25 27 int i; 26 28 NSArray *knownDocTypes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDocumentTypes"]; … … 98 100 _fileURL=nil; 99 101 _fileType=nil; 100 102 _changeCount=0; 101 _untitledNumber= 0;103 _untitledNumber=untitled_document_number++; 102 104 _hasUndoManager=YES; 103 105 _activeEditors=[NSMutableArray new]; 104 106 } … … 344 346 { 345 347 if(_fileURL==nil) 346 348 { 347 if(_untitledNumber > 1)349 if(_untitledNumber != 0) 348 350 return [NSString stringWithFormat:@"Untitled %d", _untitledNumber]; 349 351 else 350 352 return @"Untitled";
Note: See TracBrowser
for help on using the repository browser.