Minor fix to remap name if changed in custom class map.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@18760 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-03-04 06:02:24 +00:00
parent 04a1c007b5
commit d28446884d
2 changed files with 21 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2004-03-04 01:08 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m: [GormDocument setName:forObject:] added
code to remap the name of an object if it is in the custom
class map.
2004-03-03 11:00 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCustomClassInspector.[hm]: Removed _currentSelection

View file

@ -2501,6 +2501,8 @@ static NSImage *classesImage = nil;
{
id oldObject;
NSString *oldName;
NSMutableDictionary *cc = [classManager customClassMap];
NSString *className = nil;
if (object == nil)
{
@ -2569,7 +2571,6 @@ static NSImage *classesImage = nil;
aName = [aName copy]; /* Make sure it's immutable */
[nameTable setObject: object forKey: aName];
NSMapInsert(objToName, (void*)object, (void*)aName);
RELEASE(aName);
if (oldName != nil)
{
[nameTable removeObjectForKey: oldName];
@ -2578,6 +2579,19 @@ static NSImage *classesImage = nil;
{
[objectsView refreshCells];
}
// check the custom classes map and replace the appropriate
// object, if a mapping exists.
if(cc != nil)
{
className = [cc objectForKey: oldName];
if(className != nil)
{
[cc removeObjectForKey: oldName];
[cc setObject: className forKey: aName];
}
}
RELEASE(aName);
}
- (void) setObject: (id)anObject isVisibleAtLaunch: (BOOL)flag