source: trunk/aux/cocotron/win32/cocotron/cocotron-r1717c90b4d27.patch @ 14419

Last change on this file since 14419 was 14419, checked in by palter, 10 years ago

Update to Cocotron r1717c90b4d27.

File size: 1.9 KB
RevLine 
[14419]1diff -r 1717c90b4d27 AppKit/NSApplication.m
2--- a/AppKit/NSApplication.m    Fri Nov 05 16:09:59 2010 -0400
3+++ b/AppKit/NSApplication.m    Sun Nov 07 17:19:19 2010 -0500
4@@ -415,6 +415,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@@ -477,11 +481,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 1717c90b4d27 AppKit/NSDocument.m
39--- a/AppKit/NSDocument.m       Fri Nov 05 16:09:59 2010 -0400
40+++ b/AppKit/NSDocument.m       Sun Nov 07 17:19:19 2010 -0500
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.