Text style conversion
Posted: Fri Sep 21, 2007 12:38 pm
I'm having trouble with something very simple, but I just can't figure out how to do it. I need to do a text style conversion over a range of text which may include several items, and may begin and end in the middle of items. So I need to:
Is there an example somewhere of how to do this?
Cheers,
Martin
- Split the first item where the selection starts, and create a new item from the second part of it;
Create a new style for that item based on the existing style, with modifications, and apply it;
For each subsequent item which is completely inside the selection, create a new style based on its current style with my modifications, and apply it;
for the last item, split it at the point where the selection ends, create a new item from the first part of it, and apply a modified style to that.
Is there an example somewhere of how to do this?
Cheers,
Martin