mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 14:50:38 +00:00
Raise exceptions
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11357 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e82bd8f387
commit
d38ba45c96
2 changed files with 23 additions and 7 deletions
|
@ -285,10 +285,15 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
|
||||
- (void) addSubview: (NSView*)aView
|
||||
{
|
||||
if (aView == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Adding a nil subview"];
|
||||
}
|
||||
if ([self isDescendantOf: aView])
|
||||
{
|
||||
NSLog(@"Operation addSubview: creates a loop in the views tree!\n");
|
||||
return;
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"addSubview: creates a loop in the views tree!\n"];
|
||||
}
|
||||
|
||||
RETAIN(aView);
|
||||
|
@ -313,11 +318,15 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
{
|
||||
unsigned index;
|
||||
|
||||
if (aView == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Adding a nil subview"];
|
||||
}
|
||||
if ([self isDescendantOf: aView])
|
||||
{
|
||||
NSLog(@"addSubview: positioned: relativeTo: will create a cycle "
|
||||
@"in the views tree!\n");
|
||||
return;
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"addSubview: positioned: relativeTo: creates a loop in the views tree!\n"];
|
||||
}
|
||||
|
||||
if (aView == otherView)
|
||||
|
@ -2852,8 +2861,8 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
dict = [[printOp printInfo] dictionary];
|
||||
if (printOp == nil)
|
||||
{
|
||||
NSLog(@"[NSView -beginDocument] called without a current print op");
|
||||
return;
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"beginDocument called without a current print op"];
|
||||
}
|
||||
/* Inform ourselves and subviews that we're printing so we adjust
|
||||
the PostScript accordingly. Perhaps this could be in the thread
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue