Corrected crash when re-saving files.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@14848 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2002-10-26 03:39:55 +00:00
parent 57d5eb3b5f
commit 5098ec2214
2 changed files with 17 additions and 10 deletions

View file

@ -1,3 +1,10 @@
2002-10-25 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m: Removed extraneous calls to eliminate entries in the
objToName map from the endArchiving method. This has corrected the
problem w/ Gorm crashing when reloading a previously saved .gorm file
and saving again.
2002-10-25 Adam Fedor <fedor@gnu.org> 2002-10-25 Adam Fedor <fedor@gnu.org>
* GormDocument.m (-dealloc): Release tempNameTable. * GormDocument.m (-dealloc): Release tempNameTable.

View file

@ -281,33 +281,31 @@ static NSImage *classesImage = nil;
{ {
template = [[GormNSTextViewTemplate alloc] initWithObject: obj template = [[GormNSTextViewTemplate alloc] initWithObject: obj
className: className]; className: className];
[[obj superview] replaceSubview: RETAIN(obj) with: template]; [[obj superview] replaceSubview: obj with: template];
} }
else if([obj isKindOfClass: [NSText class]]) else if([obj isKindOfClass: [NSText class]])
{ {
template = [[GormNSTextTemplate alloc] initWithObject: obj template = [[GormNSTextTemplate alloc] initWithObject: obj
className: className]; className: className];
[[obj superview] replaceSubview: RETAIN(obj) with: template]; [[obj superview] replaceSubview: obj with: template];
} }
else if([obj isKindOfClass: [NSButton class]]) else if([obj isKindOfClass: [NSButton class]])
{ {
template = [[GormNSButtonTemplate alloc] initWithObject: obj template = [[GormNSButtonTemplate alloc] initWithObject: obj
className: className]; className: className];
[[obj superview] replaceSubview: RETAIN(obj) with: template]; [[obj superview] replaceSubview: obj with: template];
NSLog(@"window = %@",[template window]);
[[template window] update];
} }
else if([obj isKindOfClass: [NSControl class]]) else if([obj isKindOfClass: [NSControl class]])
{ {
template = [[GormNSControlTemplate alloc] initWithObject: obj template = [[GormNSControlTemplate alloc] initWithObject: obj
className: className]; className: className];
[[obj superview] replaceSubview: RETAIN(obj) with: template]; [[obj superview] replaceSubview: obj with: template];
} }
else if([obj isKindOfClass: [NSView class]]) else if([obj isKindOfClass: [NSView class]])
{ {
template = [[GormNSViewTemplate alloc] initWithObject: obj template = [[GormNSViewTemplate alloc] initWithObject: obj
className: className]; className: className];
[[obj superview] replaceSubview: RETAIN(obj) with: template]; [[obj superview] replaceSubview: obj with: template];
} }
else if([obj isKindOfClass: [NSMenu class]]) else if([obj isKindOfClass: [NSMenu class]])
{ {
@ -1100,15 +1098,17 @@ static NSImage *classesImage = nil;
/* /*
* Restore removed objects. * Restore removed objects.
*/ */
NSMapRemove(objToName, (void*)[nameTable objectForKey: @"NSOwner"]); // NSMapRemove(objToName, (void*)[nameTable objectForKey: @"NSOwner"]);
[nameTable setObject: filesOwner forKey: @"NSOwner"]; [nameTable setObject: filesOwner forKey: @"NSOwner"];
NSMapInsert(objToName, (void*)filesOwner, (void*)@"NSOwner"); NSMapInsert(objToName, (void*)filesOwner, (void*)@"NSOwner");
NSMapRemove(objToName, (void*)[nameTable objectForKey: @"NSFirst"]);
// NSMapRemove(objToName, (void*)[nameTable objectForKey: @"NSFirst"]);
[nameTable setObject: firstResponder forKey: @"NSFirst"]; [nameTable setObject: firstResponder forKey: @"NSFirst"];
NSMapInsert(objToName, (void*)firstResponder, (void*)@"NSFirst"); NSMapInsert(objToName, (void*)firstResponder, (void*)@"NSFirst");
if (fontManager != nil) if (fontManager != nil)
{ {
NSMapRemove(objToName, (void*)[nameTable objectForKey: @"NSFont"]); // NSMapRemove(objToName, (void*)[nameTable objectForKey: @"NSFont"]);
[nameTable setObject: fontManager forKey: @"NSFont"]; [nameTable setObject: fontManager forKey: @"NSFont"];
NSMapInsert(objToName, (void*)fontManager, (void*)@"NSFont"); NSMapInsert(objToName, (void*)fontManager, (void*)@"NSFont");
} }