Committed:

   * Source/NSCell.m (-compare:):  Compare the stringValue of
   NSCell's rather than their contents directly.

Cheers,
David

Index: Source/NSCell.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/gui/Source/NSCell.m,v
retrieving revision 1.147
diff -u -r1.147 NSCell.m
--- Source/NSCell.m     31 Jul 2003 23:52:09 -0000      1.147
+++ Source/NSCell.m     27 Sep 2003 09:04:27 -0000
@@ -1056,8 +1056,11 @@
   return [self menu];
 }
 
-/*
- * Comparing to Another NSCell
+/**
+ * Compares the reciever to another to another NSCell.
+ * The argument must be an NSCell sublclass and have
+ * the NSCellType NSTextCellType.  Returns the result
+ * of the comparison of each cell's stringVaule.
  */
 - (NSComparisonResult) compare: (id)otherCell
 {
@@ -1072,7 +1075,9 @@
       [NSException raise: NSBadComparisonException
                   format: @"Comparison between non-text cells"];
     }
-  return [_contents compare: ((NSCell*)otherCell)->_contents];
+  /* We shouldn't access instance variables directly as subclasses
+     may override stringValue to retrieve the value from somewhere else.  */
+  return [[self stringValue] compare: [(NSCell*)otherCell stringValue]];
 }
 
 /*
_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to