Implement -isEqual: and -hash.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16059 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-02-23 23:05:43 +00:00
parent 5078562c49
commit 6397b61a2a
2 changed files with 34 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2003-02-23 00:02 Alexander Malmberg <alexander@malmberg.org>
* Source/NSParagraphStyle.m: Implement -isEqual: and -hash.
2003-02-23 13:30 Alexander Malmberg <alexander@malmberg.org>
* Source/NSWindow (-update): Don't redisplay the window.

View file

@ -351,6 +351,36 @@ static NSParagraphStyle *defaultStyle = nil;
}
}
- (BOOL) isEqual: (id)aother
{
NSParagraphStyle *other = aother;
if (other == self)
return YES;
if ([other isKindOfClass: [NSParagraphStyle class]] == NO)
return NO;
#define C(x) if (x != other->x) return NO
C(_lineSpacing);
C(_paragraphSpacing);
C(_headIndent);
C(_tailIndent);
C(_firstLineHeadIndent);
C(_minimumLineHeight);
C(_maximumLineHeight);
C(_alignment);
C(_lineBreakMode);
#undef C
return [_tabStops isEqualToArray: other->_tabStops];
}
- (unsigned int) hash
{
return _alignment + _lineBreakMode;
}
@end