mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-24 03:51:22 +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>
|
2005-07-14 12:39 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* GormCore/GormDocument.m: Minor change to changeView: to
|
* GormCore/GormDocument.m: Minor change to changeView: to
|
||||||
|
|
|
@ -178,7 +178,7 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
||||||
- (void) switchView
|
- (void) switchView
|
||||||
{
|
{
|
||||||
NSString *viewType = [[NSUserDefaults standardUserDefaults] stringForKey: @"ClassViewType"];
|
NSString *viewType = [[NSUserDefaults standardUserDefaults] stringForKey: @"ClassViewType"];
|
||||||
NSString *selectedClassName = [self selectedClassName];
|
// NSString *selectedClassName = [self selectedClassName];
|
||||||
|
|
||||||
[self setContentViewMargins: NSZeroSize];
|
[self setContentViewMargins: NSZeroSize];
|
||||||
if([viewType isEqual: @"Outline"] || viewType == nil)
|
if([viewType isEqual: @"Outline"] || viewType == nil)
|
||||||
|
@ -228,23 +228,32 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
||||||
{
|
{
|
||||||
id className = nil;
|
id className = nil;
|
||||||
|
|
||||||
if([self contentView] == scrollView)
|
NS_DURING
|
||||||
{
|
{
|
||||||
int row = [outlineView selectedRow];
|
if([self contentView] == scrollView)
|
||||||
if ( row == -1 )
|
|
||||||
row = 0;
|
|
||||||
#warning add exception
|
|
||||||
className = [outlineView itemAtRow: row];
|
|
||||||
|
|
||||||
if ([className isKindOfClass: [GormOutletActionHolder class]])
|
|
||||||
{
|
{
|
||||||
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;
|
return className;
|
||||||
}
|
}
|
||||||
|
@ -261,7 +270,6 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
||||||
NSArray *classes, *subclasses;
|
NSArray *classes, *subclasses;
|
||||||
NSMutableArray *subClassesArray = [NSMutableArray array];
|
NSMutableArray *subClassesArray = [NSMutableArray array];
|
||||||
NSEnumerator *en;
|
NSEnumerator *en;
|
||||||
NSString *superClass;
|
|
||||||
int row = 0;
|
int row = 0;
|
||||||
int col = 0;
|
int col = 0;
|
||||||
|
|
||||||
|
@ -291,7 +299,7 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
||||||
}
|
}
|
||||||
|
|
||||||
// select class in browser...
|
// select class in browser...
|
||||||
subClassesArray = [classManager allSuperClassesOf: className];
|
subClassesArray = AUTORELEASE([[classManager allSuperClassesOf: className] mutableCopy]);
|
||||||
if ((subClassesArray == nil || [subClassesArray count] == 0) &&
|
if ((subClassesArray == nil || [subClassesArray count] == 0) &&
|
||||||
[classManager isRootClass: className] == NO)
|
[classManager isRootClass: className] == NO)
|
||||||
{
|
{
|
||||||
|
@ -375,12 +383,19 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
||||||
|
|
||||||
if (i >= 0 && i <= ([outlineView numberOfRows] - 1))
|
if (i >= 0 && i <= ([outlineView numberOfRows] - 1))
|
||||||
{
|
{
|
||||||
#warning Add exception
|
NS_DURING
|
||||||
id object = [outlineView itemAtRow: i];
|
|
||||||
if([object isKindOfClass: [NSString class]])
|
|
||||||
{
|
{
|
||||||
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)
|
else if([self contentView] == browserView)
|
||||||
|
@ -492,8 +507,18 @@ NSString *GormSwitchViewPreferencesNotification = @"GormSwitchViewPreferencesNot
|
||||||
{
|
{
|
||||||
return;
|
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]])
|
if ([anitem isKindOfClass: [GormOutletActionHolder class]])
|
||||||
{
|
{
|
||||||
id itemBeingEdited = [outlineView itemBeingEdited];
|
id itemBeingEdited = [outlineView itemBeingEdited];
|
||||||
|
@ -1126,12 +1151,19 @@ shouldEditTableColumn: (NSTableColumn *)tableColumn
|
||||||
|
|
||||||
if(row != -1)
|
if(row != -1)
|
||||||
{
|
{
|
||||||
#warning add exception
|
NS_DURING
|
||||||
id item = [object itemAtRow: [object selectedRow]];
|
|
||||||
if (![item isKindOfClass: [GormOutletActionHolder class]])
|
|
||||||
{
|
{
|
||||||
[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;
|
current = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"current %i",current);
|
NSDebugLog(@"current %i",current);
|
||||||
|
|
||||||
// Operate on the document view if the selected object is a NSScrollView
|
// Operate on the document view if the selected object is a NSScrollView
|
||||||
if ([obj isKindOfClass: [NSScrollView class]]
|
if ([obj isKindOfClass: [NSScrollView class]]
|
||||||
|
|
Loading…
Reference in a new issue