mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 19:51:00 +00:00
Changed a log and added some exception handling.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21480 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5c90039127
commit
2f9ccc2a40
3 changed files with 64 additions and 25 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-07-15 00:54 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormCore/GormClassEditor.m: Added exception handling to portions
|
||||
of code which call itemAtIndex: method on the outline view to
|
||||
prevent any problems.
|
||||
* GormCore/GormInspectorsManager.m: Changed a NSLog to NSDebugLog.
|
||||
|
||||
2005-07-14 12:39 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormCore/GormDocument.m: Minor change to changeView: to
|
||||
|
|
|
@ -178,7 +178,7 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
|||
- (void) switchView
|
||||
{
|
||||
NSString *viewType = [[NSUserDefaults standardUserDefaults] stringForKey: @"ClassViewType"];
|
||||
NSString *selectedClassName = [self selectedClassName];
|
||||
// NSString *selectedClassName = [self selectedClassName];
|
||||
|
||||
[self setContentViewMargins: NSZeroSize];
|
||||
if([viewType isEqual: @"Outline"] || viewType == nil)
|
||||
|
@ -228,23 +228,32 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
|||
{
|
||||
id className = nil;
|
||||
|
||||
if([self contentView] == scrollView)
|
||||
NS_DURING
|
||||
{
|
||||
int row = [outlineView selectedRow];
|
||||
if ( row == -1 )
|
||||
row = 0;
|
||||
#warning add exception
|
||||
className = [outlineView itemAtRow: row];
|
||||
|
||||
if ([className isKindOfClass: [GormOutletActionHolder class]])
|
||||
if([self contentView] == scrollView)
|
||||
{
|
||||
className = [outlineView itemBeingEdited];
|
||||
int row = [outlineView selectedRow];
|
||||
if ( row == -1 )
|
||||
{
|
||||
row = 0;
|
||||
}
|
||||
|
||||
className = [outlineView itemAtRow: row];
|
||||
if ([className isKindOfClass: [GormOutletActionHolder class]])
|
||||
{
|
||||
className = [outlineView itemBeingEdited];
|
||||
}
|
||||
}
|
||||
else if([self contentView] == browserView)
|
||||
{
|
||||
className = [[browserView selectedCell] stringValue];
|
||||
}
|
||||
}
|
||||
else if([self contentView] == browserView)
|
||||
NS_HANDLER
|
||||
{
|
||||
className = [[browserView selectedCell] stringValue];
|
||||
NSLog(@"%@",[localException reason]);
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
return className;
|
||||
}
|
||||
|
@ -261,7 +270,6 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
|||
NSArray *classes, *subclasses;
|
||||
NSMutableArray *subClassesArray = [NSMutableArray array];
|
||||
NSEnumerator *en;
|
||||
NSString *superClass;
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
|
||||
|
@ -291,7 +299,7 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
|||
}
|
||||
|
||||
// select class in browser...
|
||||
subClassesArray = [classManager allSuperClassesOf: className];
|
||||
subClassesArray = AUTORELEASE([[classManager allSuperClassesOf: className] mutableCopy]);
|
||||
if ((subClassesArray == nil || [subClassesArray count] == 0) &&
|
||||
[classManager isRootClass: className] == NO)
|
||||
{
|
||||
|
@ -375,12 +383,19 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
|||
|
||||
if (i >= 0 && i <= ([outlineView numberOfRows] - 1))
|
||||
{
|
||||
#warning Add exception
|
||||
id object = [outlineView itemAtRow: i];
|
||||
if([object isKindOfClass: [NSString class]])
|
||||
NS_DURING
|
||||
{
|
||||
result = YES;
|
||||
id object = [outlineView itemAtRow: i];
|
||||
if([object isKindOfClass: [NSString class]])
|
||||
{
|
||||
result = YES;
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"%@",[localException reason]);
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
}
|
||||
}
|
||||
else if([self contentView] == browserView)
|
||||
|
@ -492,8 +507,18 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
|||
{
|
||||
return;
|
||||
}
|
||||
#warning add exception
|
||||
anitem = [outlineView itemAtRow: i];
|
||||
|
||||
// get the item, and catch the exception, if there's a problem.
|
||||
NS_DURING
|
||||
{
|
||||
anitem = [outlineView itemAtRow: i];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
anitem = nil;
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
if ([anitem isKindOfClass: [GormOutletActionHolder class]])
|
||||
{
|
||||
id itemBeingEdited = [outlineView itemBeingEdited];
|
||||
|
@ -1126,12 +1151,19 @@ shouldEditTableColumn: (NSTableColumn *)tableColumn
|
|||
|
||||
if(row != -1)
|
||||
{
|
||||
#warning add exception
|
||||
id item = [object itemAtRow: [object selectedRow]];
|
||||
if (![item isKindOfClass: [GormOutletActionHolder class]])
|
||||
NS_DURING
|
||||
{
|
||||
[self editClass];
|
||||
id item = [object itemAtRow: [object selectedRow]];
|
||||
if (![item isKindOfClass: [GormOutletActionHolder class]])
|
||||
{
|
||||
[self editClass];
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"%@",[localException reason]);
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -468,7 +468,7 @@
|
|||
current = 0;
|
||||
}
|
||||
|
||||
NSLog(@"current %i",current);
|
||||
NSDebugLog(@"current %i",current);
|
||||
|
||||
// Operate on the document view if the selected object is a NSScrollView
|
||||
if ([obj isKindOfClass: [NSScrollView class]]
|
||||
|
|
Loading…
Reference in a new issue