bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in comparison of NSCells


From: David Ayers
Subject: Re: bug in comparison of NSCells
Date: Thu, 25 Sep 2003 11:51:56 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030507

Benhur Stein wrote:

With the recent change that obsoleted -compare: in NSObject, NSCells that are
text cells, containing attributed strings instead of strings are logging
a warning when compared. Should the -compare: method in NSCell be extended to include the comparison of NSAttributedStrings, or NSAttributedString be extended to include a -compare: method (which I think would be better, even if not in Openstep)?

Hello Benhur!

Interesting indeed. I've just checked on OS 4.2 and also had it confirmed for OS X that NSAttributedString doesn't implement -compare: Right now I'm leaning towards changing the implementation of NSCell-compare: to:
 ...
 return [[self stringValue] compare: [(NSCell*)otherCell stringValue]];
/me wonders whether to check whether comparing an attributed cell with a non attributed cell raises an exception on OS 4.2/X...

OTOH, I also feel that NSAttributedStrings should be comparable. So I'll wait on some feedback from others, on whether we want this extension.

But one good thing is, that we did find this bug, as these cells are currently compared by the location of their _contents in memory.

Cheers,
David






reply via email to

[Prev in Thread] Current Thread [Next in Thread]