source: trunk/aux/cocotron/win32/cocotron/cocotron-r59942ee67d15.patch @ 14420

Last change on this file since 14420 was 14420, checked in by palter, 11 years ago

Revert previous change -- Cocotron is broken

File size: 1.9 KB
RevLine 
[14237]1diff -r 59942ee67d15 AppKit/NSApplication.m
2--- a/AppKit/NSApplication.m    Fri Sep 03 14:44:12 2010 -0400
3+++ b/AppKit/NSApplication.m    Tue Sep 07 18:15:00 2010 -0400
4@@ -418,6 +418,10 @@
5        needsUntitled = [_delegate applicationShouldOpenUntitledFile: self];
6    }
7 
8+   if(needsUntitled && _delegate && [_delegate respondsToSelector: @selector(applicationOpenUntitledFile:)]) {
9+     needsUntitled = ![_delegate applicationOpenUntitledFile: self];
10+   }
11+
12    if(needsUntitled && controller && ![controller documentClassForType:[controller defaultType]]) {
13        needsUntitled = NO;
14    }
15@@ -472,11 +476,17 @@
16 
17 -(void)run {
18     
19-   NSAutoreleasePool *pool=[NSAutoreleasePool new];
20-   [self finishLaunching];
21-   [pool release];
22-   
23-   _isRunning=YES;
24+  static BOOL didlaunch = NO;
25+  NSAutoreleasePool *pool;
26+
27+  _isRunning=YES;
28+
29+  if (!didlaunch) {
30+    didlaunch = YES;
31+    pool=[NSAutoreleasePool new];
32+    [self finishLaunching];
33+    [pool release];
34+  }
35   
36    do {
37        pool = [NSAutoreleasePool new];
38diff -r 59942ee67d15 AppKit/NSDocument.m
39--- a/AppKit/NSDocument.m       Fri Sep 03 14:44:12 2010 -0400
40+++ b/AppKit/NSDocument.m       Tue Sep 07 18:15:00 2010 -0400
41@@ -21,6 +21,8 @@
42 
43 @implementation NSDocument
44 
45+static int untitled_document_number = 0;
46+
47 +(NSArray *)readableTypes {
48    int             i;
49    NSArray        *knownDocTypes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDocumentTypes"];
50@@ -98,7 +100,7 @@
51       _fileURL=nil;
52       _fileType=nil;
53       _changeCount=0;
54-      _untitledNumber=0;
55+      _untitledNumber=untitled_document_number++;
56       _hasUndoManager=YES;
57       _activeEditors=[NSMutableArray new];
58     }
59@@ -340,7 +342,7 @@
60 {
61   if(_fileURL==nil)
62     {
63-      if(_untitledNumber > 1)
64+      if(_untitledNumber != 0)
65         return [NSString stringWithFormat:@"Untitled %d", _untitledNumber];
66       else
67         return @"Untitled";
Note: See TracBrowser for help on using the repository browser.