diff --git a/ChangeLog b/ChangeLog index ebe1e92d7..ac605ef08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-08 10:09-EST Gregory John Casamento + + * Source/NSDocument.m: Correction for bug#24758, add name and + type information to the object before reading the file so that + it is available during the readFile:ofType: method call. + 2008-11-06 Fred Kiefer * Source/NSBitmapImageRep.m (-_convertToFormatBitsPerSample:...): @@ -32,6 +38,7 @@ * Source/NSPopUpButton.m (-keyDown): Trigger action only after pressing the Space key. +>>>>>>> .r27016 2008-11-01 21:35-EDT Gregory John Casamento * Source/NSWindow.m: Reverted a previous change to miniaturize. diff --git a/Source/NSDocument.m b/Source/NSDocument.m index eeb2b7ba3..0ae6c9bdb 100644 --- a/Source/NSDocument.m +++ b/Source/NSDocument.m @@ -96,12 +96,9 @@ self = [self init]; if (self != nil) { - if ([self readFromFile: fileName ofType: fileType]) - { - [self setFileType: fileType]; - [self setFileName: fileName]; - } - else + [self setFileType: fileType]; + [self setFileName: fileName]; + if (![self readFromFile: fileName ofType: fileType]) { NSRunAlertPanel (_(@"Load failed"), _(@"Could not load file %@."), @@ -122,12 +119,9 @@ self = [self init]; if (self != nil) { - if ([self readFromURL: url ofType: fileType]) - { - [self setFileType: fileType]; - [self setFileName: [url path]]; - } - else + [self setFileType: fileType]; + [self setFileName: [url path]]; + if (![self readFromURL: url ofType: fileType]) { NSRunAlertPanel(_(@"Load failed"), _(@"Could not load URL %@."),