Minor fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7773 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 2000-10-09 12:08:04 +00:00
parent 723da3ed66
commit 72e4399351
2 changed files with 10 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2000-10-09 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSGAttributedString.m: ([-setAttributes:range:])
Fixed obscure bug - use ASSIGNCOPY rather than ASSIGN to prevent
mutable dictionaries being placed in attributed string.
2000-10-09 Richard Frith-Macdonald <rfm@gnu.org> 2000-10-09 Richard Frith-Macdonald <rfm@gnu.org>
Major rewrite of NSString. Major rewrite of NSString.

View file

@ -464,7 +464,7 @@ SANITY();
- (void) setAttributes: (NSDictionary*)attributes - (void) setAttributes: (NSDictionary*)attributes
range: (NSRange)range range: (NSRange)range
{ {
unsigned tmpLength, arrayIndex, arraySize, location; unsigned tmpLength, arrayIndex, arraySize;
NSRange effectiveRange; NSRange effectiveRange;
unsigned afterRangeLoc, beginRangeLoc; unsigned afterRangeLoc, beginRangeLoc;
NSDictionary *attrs; NSDictionary *attrs;
@ -533,14 +533,10 @@ SANITY();
} }
info = OBJECTAT(arrayIndex); info = OBJECTAT(arrayIndex);
location = info->loc; if (info->loc >= beginRangeLoc)
if (location >= beginRangeLoc)
{ {
if (location > beginRangeLoc) info->loc = beginRangeLoc;
{ ASSIGNCOPY(info->attrs, attributes);
info->loc = beginRangeLoc;
}
ASSIGN(info->attrs, attributes);
} }
else else
{ {