Correction for invalid window level. bug#21723

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@25847 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2008-01-03 19:51:16 +00:00
parent c5122085ce
commit 6e3b735155
2 changed files with 55 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2008-01-03 14:50-EST Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormGormWrapperLoader.m: Correct invalid window level
in _repairFile: method.
2008-01-01 23:07-EST Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormGormWrapperLoader.m: Touch the document to mark it

View file

@ -44,6 +44,17 @@
}
@end
@interface NSWindow (Level)
- (int) windowLevel;
@end;
@implementation NSWindow (Level)
- (int) windowLevel
{
return _windowLevel;
}
@end;
@implementation GormGormWrapperLoader
+ (NSString *) type
{
@ -177,6 +188,16 @@
NSArray *allViews = allSubviews([obj contentView]);
NSEnumerator *ven = [allViews objectEnumerator];
id v = nil;
if([obj windowLevel] != NSNormalWindowLevel)
{
[obj setLevel: NSNormalWindowLevel];
[_repairLog addObject:
[NSString stringWithFormat:
@"ERROR ==> Found window %@ with an invalid level, correcting.\n",
obj]];
errorCount++;
}
while((v = [ven nextObject]) != nil)
{
@ -239,15 +260,43 @@
en = [connections objectEnumerator];
while((con = [en nextObject]) != nil)
{
id src = [con source];
id dst = [con destination];
if([con isKindOfClass: [NSNibConnector class]])
{
if([con source] == nil)
if(src == nil)
{
[_repairLog addObject:
[NSString stringWithFormat: @"ERROR ==> Removing bad connector with nil source: %@\n",con]];
[document removeConnector: con];
errorCount++;
}
else if([src isKindOfClass: [NSString class]])
{
id obj = [document objectForName: src];
if(obj == nil)
{
[_repairLog addObject:
[NSString stringWithFormat:
@"ERROR ==> Removing bad connector with source that is not in the nametable: %@\n",
con]];
[document removeConnector: con];
errorCount++;
}
}
else if([dst isKindOfClass: [NSString class]])
{
id obj = [document objectForName: dst];
if(obj == nil)
{
[_repairLog addObject:
[NSString stringWithFormat:
@"ERROR ==> Removing bad connector with destination that is not in the nametable: %@\n",
con]];
[document removeConnector: con];
errorCount++;
}
}
}
}