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 Frith-MacDonald 2000-10-09 12:08:04 +00:00
parent b09654b1a4
commit cd50020ae6
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>
Major rewrite of NSString.

View file

@ -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
{