From 4d25305e2e732841a0927ed98d0056a3f1298159 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Sat, 13 Jan 2001 20:33:32 +0000 Subject: [PATCH] A few text storage bugfixes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8585 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/GSTextStorage.m | 15 +++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ff580068..d807ffdf0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-01-13 Richard Frith-Macdonald + + * Source/GSTextStorage.m: Fixed bug initialising from an + empty attributed string, and fixed bug replacing characters in + range, when an attribute range location is the same s the location + of the replaced characters. + Sat Jan 13 12:24:55 2001 Nicola Pero * Source/NSApplication.m (_NSAppKitUncaughtExceptionHandler): diff --git a/Source/GSTextStorage.m b/Source/GSTextStorage.m index 6c41c012a..9feb05dc9 100644 --- a/Source/GSTextStorage.m +++ b/Source/GSTextStorage.m @@ -278,10 +278,14 @@ _setAttributesFrom( [_infoArray removeAllObjects]; if (aRange.length <= 0) - return; - - attr = [attributedString attributesAtIndex: aRange.location - effectiveRange: &range]; + { + attr = [NSDictionary dictionary]; + } + else + { + attr = [attributedString attributesAtIndex: aRange.location + effectiveRange: &range]; + } attr = cacheAttributes(attr); info = NEWINFO(z, attr, 0); ADDOBJECT(info); @@ -731,11 +735,11 @@ SANITY(); } } info->loc = NSMaxRange(range); -SANITY(); } moveLocations = [aString length] - range.length; if (effectiveRange.location == range.location + && effectiveRange.length == range.length && (moveLocations + range.length) == 0) { /* @@ -748,7 +752,6 @@ SANITY(); arraySize--; } -SANITY(); /* * Now adjust the positions of the ranges following the one we are using. */