Change to correct some crashes which I just detected

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20462 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-12-18 02:29:31 +00:00
parent 6be559f890
commit 68ef08b403
3 changed files with 36 additions and 22 deletions

View file

@ -1,3 +1,9 @@
2004-12-17 21:28 Gregory John Casamento <greg_casamento@yahoo.com>
* GormClassInspector.m: Set the double action and target
for parentClass.
* GormObjectEditor.m: Moved the pasteInSelection method.
2004-12-17 05:48 Gregory John Casamento <greg_casamento@yahoo.com> 2004-12-17 05:48 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m: Changed implementation here to call the one * GormDocument.m: Changed implementation here to call the one

View file

@ -291,6 +291,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
[outletTable setDataSource: outletData]; [outletTable setDataSource: outletData];
[parentClass setDataSource: parentClassData]; [parentClass setDataSource: parentClassData];
[parentClass setDoubleAction: @selector(selectClass:)]; [parentClass setDoubleAction: @selector(selectClass:)];
[parentClass setTarget: self];
// delegate... // delegate...
[actionTable setDelegate: self]; [actionTable setDelegate: self];
@ -471,26 +472,34 @@ objectValueForTableColumn: (NSTableColumn *)tc
{ {
NSArray *list = [classManager allClassNames]; NSArray *list = [classManager allClassNames];
int row = [parentClass selectedRow]; int row = [parentClass selectedRow];
NSString *newParent = [list objectAtIndex: row];
NSString *name = [self _currentClass];
BOOL removed = NO;
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
// check to see if the user wants to do this and remove the connections. if(row >= 0)
removed = [document removeConnectionsForClassNamed: name];
// if removed, move the class and notify...
if(removed)
{ {
NSString *oldSuper = [classManager superClassNameForClassNamed: name]; NSString *newParent = [list objectAtIndex: row];
NSString *name = [self _currentClass];
BOOL removed = NO;
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
[classManager setSuperClassNamed: newParent forClassNamed: name]; // if it's a custom class, let it go, if not do nothing.
[nc postNotificationName: IBInspectorDidModifyObjectNotification if([classManager isCustomClass: name])
object: classManager]; {
[document collapseClass: oldSuper]; // check to see if the user wants to do this and remove the connections.
[document collapseClass: name]; removed = [document removeConnectionsForClassNamed: name];
[document reloadClasses];
[document selectClass: name]; // if removed, move the class and notify...
if(removed)
{
NSString *oldSuper = [classManager superClassNameForClassNamed: name];
[classManager setSuperClassNamed: newParent forClassNamed: name];
[nc postNotificationName: IBInspectorDidModifyObjectNotification
object: classManager];
[document collapseClass: oldSuper];
[document collapseClass: name];
[document reloadClasses];
[document selectClass: name];
}
}
} }
} }

View file

@ -138,6 +138,10 @@ static NSMapTable *docMap = 0;
return NO; return NO;
} }
- (void) pasteInSelection
{
}
- (void) copySelection - (void) copySelection
{ {
if (selected != nil) if (selected != nil)
@ -433,11 +437,6 @@ static NSMapTable *docMap = 0;
[super mouseDown: theEvent]; [super mouseDown: theEvent];
} }
- (void) pasteInSelection
{
}
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender - (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
{ {
if (dragType == IBObjectPboardType) if (dragType == IBObjectPboardType)