From 3071d5e99f9b164114ac1a1872fa35c902ba051b Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 25 Mar 1999 09:45:49 +0000 Subject: [PATCH] Added exceptions git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3977 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Source/NSCell.m | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b56c86693..497da5c5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Mar 25 09:12:00 1999 Richard Frith-Macdonald + + Source/NSCell.m: Added all the exceptions mentioned in the docs. + Wed Mar 24 10:52:00 1999 Richard Frith-Macdonald * Source/NSMenu.m: ([-acceptsFirstmouse:]) implemented. diff --git a/Source/NSCell.m b/Source/NSCell.m index 6f70d3858..e45956aa4 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -694,6 +695,8 @@ - (void) setAction: (SEL)aSelector { + [NSException raise: NSInternalInconsistencyException + format: @"attempt to set an action in an NSCell"]; } - (BOOL) isContinuous @@ -718,6 +721,8 @@ - (void) setTarget: (id)anObject { + [NSException raise: NSInternalInconsistencyException + format: @"attempt to set a target in an NSCell"]; } - (id) target @@ -751,6 +756,8 @@ // - (void) setTag: (int)anInt { + [NSException raise: NSInternalInconsistencyException + format: @"attempt to set a tag in an NSCell"]; } - (int) tag @@ -763,7 +770,7 @@ // - (NSString*) keyEquivalent { - return nil; + return @""; } // @@ -943,7 +950,14 @@ // - (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]; } //