Added exceptions

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3977 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-03-25 09:45:49 +00:00
parent 74ef9ed673
commit 3071d5e99f
2 changed files with 20 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Thu Mar 25 09:12:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
Source/NSCell.m: Added all the exceptions mentioned in the docs.
Wed Mar 24 10:52:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk> Wed Mar 24 10:52:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSMenu.m: ([-acceptsFirstmouse:]) implemented. * Source/NSMenu.m: ([-acceptsFirstmouse:]) implemented.

View file

@ -33,6 +33,7 @@
#include <Foundation/NSException.h> #include <Foundation/NSException.h>
#include <Foundation/NSValue.h> #include <Foundation/NSValue.h>
#include <AppKit/AppKitExceptions.h>
#include <AppKit/NSApplication.h> #include <AppKit/NSApplication.h>
#include <AppKit/NSWindow.h> #include <AppKit/NSWindow.h>
#include <AppKit/NSImage.h> #include <AppKit/NSImage.h>
@ -694,6 +695,8 @@
- (void) setAction: (SEL)aSelector - (void) setAction: (SEL)aSelector
{ {
[NSException raise: NSInternalInconsistencyException
format: @"attempt to set an action in an NSCell"];
} }
- (BOOL) isContinuous - (BOOL) isContinuous
@ -718,6 +721,8 @@
- (void) setTarget: (id)anObject - (void) setTarget: (id)anObject
{ {
[NSException raise: NSInternalInconsistencyException
format: @"attempt to set a target in an NSCell"];
} }
- (id) target - (id) target
@ -751,6 +756,8 @@
// //
- (void) setTag: (int)anInt - (void) setTag: (int)anInt
{ {
[NSException raise: NSInternalInconsistencyException
format: @"attempt to set a tag in an NSCell"];
} }
- (int) tag - (int) tag
@ -763,7 +770,7 @@
// //
- (NSString*) keyEquivalent - (NSString*) keyEquivalent
{ {
return nil; return @"";
} }
// //
@ -943,7 +950,14 @@
// //
- (NSComparisonResult) compare: (id)otherCell - (NSComparisonResult) compare: (id)otherCell
{ {
return 0; if ([otherCell isKindOfClass: [NSCell class]] == NO)
[NSException raise: NSBadComparisonException
format: @"NSCell comparison with non-NSCell"];
if (cell_type != NSTextCellType
|| ((NSCell*)otherCell)->cell_type != NSTextCellType)
[NSException raise: NSBadComparisonException
format: @"Comparison between non-text cells"];
return [contents compare: ((NSCell*)otherCell)->contents];
} }
// //