And plugged in the deletion stuff into the rest of attrstr.c. We're on a roll here!
This commit is contained in:
parent
0503110ddd
commit
e9fdbf33f3
|
@ -184,11 +184,12 @@ static int attrDeleteRange(uiAttributedString *s, struct attr *a, size_t start,
|
||||||
tmp.end = end;
|
tmp.end = end;
|
||||||
tmp.next = b;
|
tmp.next = b;
|
||||||
|
|
||||||
// and now push c back to overwrite the deleted stuff
|
// and now push b back to overwrite the deleted stuff
|
||||||
a->next = b;
|
a->next = b;
|
||||||
b->start -= count;
|
b->start -= count;
|
||||||
b->end -= count;
|
b->end -= count;
|
||||||
|
if (a == s->lastattr)
|
||||||
|
s->lastattr = a->next;
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -566,6 +567,9 @@ void uiAttributedStringDelete(uiAttributedString *s, size_t start, size_t end)
|
||||||
s->s[start + count] = 0;
|
s->s[start + count] = 0;
|
||||||
s->u16[start16 + count16] = 0;
|
s->u16[start16 + count16] = 0;
|
||||||
|
|
||||||
|
// fix up attributes
|
||||||
|
attrAdjustPostDelete(s, start, end);
|
||||||
|
|
||||||
// and finally resize
|
// and finally resize
|
||||||
resize(s, start + count, start16 + count16);
|
resize(s, start + count, start16 + count16);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue