diff --git a/ChangeLog b/ChangeLog index 026b89558..6a0aa5b60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-10-09 Richard Frith-Macdonald + + * 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 Major rewrite of NSString. diff --git a/Source/NSGAttributedString.m b/Source/NSGAttributedString.m index 899d87c32..6ac9a29fe 100644 --- a/Source/NSGAttributedString.m +++ b/Source/NSGAttributedString.m @@ -464,7 +464,7 @@ SANITY(); - (void) setAttributes: (NSDictionary*)attributes range: (NSRange)range { - unsigned tmpLength, arrayIndex, arraySize, location; + unsigned tmpLength, arrayIndex, arraySize; NSRange effectiveRange; unsigned afterRangeLoc, beginRangeLoc; NSDictionary *attrs; @@ -533,14 +533,10 @@ SANITY(); } info = OBJECTAT(arrayIndex); - location = info->loc; - if (location >= beginRangeLoc) + if (info->loc >= beginRangeLoc) { - if (location > beginRangeLoc) - { - info->loc = beginRangeLoc; - } - ASSIGN(info->attrs, attributes); + info->loc = beginRangeLoc; + ASSIGNCOPY(info->attrs, attributes); } else {