Attributed string bugfix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6409 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-04-02 17:12:00 +00:00
parent 6b01a5a050
commit 198a414d6b
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2000-04-02 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSAttributedString.m: Infinite loop fix by Fred Kiefer to
([replaceCharactersInRange:withAttributedString:])
2000-03-29 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSUserDefaults.m: typo reported by karl@nfox.com fixed.

View file

@ -621,17 +621,18 @@ static Class NSMutableAttributedString_concrete_class;
NSRange ownRange;
NSDictionary *attrDict;
NSString *tmpStr;
unsigned loc;
tmpStr = [attributedString string];
[self replaceCharactersInRange: aRange withString: tmpStr];
effectiveRange = NSMakeRange(0,0);
clipRange = NSMakeRange(0,[tmpStr length]);
while (NSMaxRange(effectiveRange) < NSMaxRange(clipRange))
while ((loc = NSMaxRange(effectiveRange)) < NSMaxRange(clipRange))
{
attrDict = [attributedString attributesAtIndex: effectiveRange.location
attrDict = [attributedString attributesAtIndex: loc
effectiveRange: &effectiveRange];
ownRange = NSIntersectionRange(clipRange,effectiveRange);
ownRange = NSIntersectionRange(clipRange, effectiveRange);
ownRange.location += aRange.location;
[self setAttributes: attrDict range: ownRange];
}