[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fix: GSTextStorage, setAttributes:range:
From: |
Richard Frith-Macdonald |
Subject: |
Re: Fix: GSTextStorage, setAttributes:range: |
Date: |
Mon, 18 Dec 2000 10:10:01 +0000 |
On Saturday, December 16, 2000, at 10:56 PM, Georg Fleischmann wrote:
> Hi,
>
> here is a fix for GSTextStorage. It ensures that the first attribute starts
> at
> location = 0. Otherwise _attributesAtIndexEffectiveRange() would raise.
>
> Georg
Hmm ... I'm not convinced.
1. As far as I can see, it should be impossible for info-loc to be greater than
beginRangeLoc and for arrayIndex to be zero - so the change would have no
effect.
(of course, I could have missed something here).
2. If the change could work - it would give the wrong result ... since you would
extend the set attributes back to the start of the string - which is not what
the
method is supposed to do.
>
> 2000-12-16 Georg Fleischmann
>
> * gui/Source/GSTextStorage.m ([GSTextStorage -setAttributes:range:]):
> first attribute always starts at loc = 0
>
>
> *** gui/Source/GSTextStorage.m.old Sat Dec 16 19:25:08 2000
> --- gui/Source/GSTextStorage.m Sat Dec 16 19:25:31 2000
> ***************
> *** 621,627 ****
> info = OBJECTAT(arrayIndex);
> if (info->loc >= beginRangeLoc || info->attrs == attributes)
> {
> ! info->loc = beginRangeLoc;
> unCacheAttributes(info->attrs);
> RELEASE(info->attrs);
> info->attrs = attributes;
> --- 621,630 ----
> info = OBJECTAT(arrayIndex);
> if (info->loc >= beginRangeLoc || info->attrs == attributes)
> {
> ! if (arrayIndex == 0)
> ! info->loc = 0;
> ! else
> ! info->loc = beginRangeLoc;
> unCacheAttributes(info->attrs);
> RELEASE(info->attrs);
> info->attrs = attributes;