diff --git a/ChangeLog b/ChangeLog index f5bd13167..ed2fc0da4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-03-17 Pierre-Yves Rivaille + + * Source/GSAttributedString.m + ([GSMutableAttributedString -replaceCharactersInRange:withString:]): + Only keep attribute #0 when removing it would remove all attributes. + (patch by Alexander Malmberg) + 2002-03-16 Adam Fedor * configure.in: Also configure SSL. diff --git a/Source/GSAttributedString.m b/Source/GSAttributedString.m index 734b244d1..1ce520b6e 100644 --- a/Source/GSAttributedString.m +++ b/Source/GSAttributedString.m @@ -825,23 +825,8 @@ SANITY(); } else { - if (arrayIndex != 0) - { - REMOVEAT(arrayIndex); - arraySize--; - } - else - { - NSDictionary *d = blank; - - unCacheAttributes(info->attrs); - DESTROY(info->attrs); - d = cacheAttributes(d); - info->attrs = d; - /* set location so it will be correct after being modified - below */ - info->loc = NSMaxRange(range); - } + REMOVEAT(arrayIndex); + arraySize--; } } @@ -860,7 +845,7 @@ SANITY(); && effectiveRange.length == range.length) { arrayIndex--; - if (arrayIndex!=0) + if (arrayIndex!=0 || arraySize > 1) { REMOVEAT(arrayIndex); arraySize--;