From 49accf9fc890ad94b47713718644fdc749fdc7e9 Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Wed, 25 Mar 2009 02:43:29 -0700 Subject: [PATCH] Fix for CPAttributedString bug #245 [#245 state:resolved milestone:0.7] --- Foundation/CPAttributedString.j | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Foundation/CPAttributedString.j b/Foundation/CPAttributedString.j index 15a7c27687..431c4ba8b6 100644 --- a/Foundation/CPAttributedString.j +++ b/Foundation/CPAttributedString.j @@ -20,8 +20,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -@import -@import +@import "CPObject.j" +@import "CPString.j" +@import "CPDictionary.j" +@import "CPRange.j" /*! @class CPAttributedString @ingroup foundation @@ -502,7 +504,7 @@ var startingIndex = [self _indexOfEntryWithIndex:aRange.location], startingRangeEntry = _rangeEntries[startingIndex], - endingIndex = [self _indexOfEntryWithIndex:CPMaxRange(aRange)-1], + endingIndex = [self _indexOfEntryWithIndex:MAX(CPMaxRange(aRange)-1, 0)], endingRangeEntry = _rangeEntries[endingIndex], additionalLength = aString.length - aRange.length;