On Tue, 27 Apr 2004, Ryan Ackley wrote: > That is wrong and right somewhat. Going along with the way you want to > do it...why you have your paragraph, you can get the character runs, now > look for the text in your character runs. delete the individual > character runs.
Well, editing the contents of the character run might be a nicer solution long term, but from the code it doesn't look like it'd be easy now. If I'm going to trash a character run, then create a new one with my changed text, I'd want to do so with the same character properties. Is there a reason why you couldn't have a character run clone its _props for you, and return that? > The problem with doing it that way is that the Range offsets are stored > as byte offsets and not character offsets. So if you have unicode > characters this will be off somewhat. May be I need to look at fixing > that. I notice that a range (and hence paragraph and characterrun) don't get at PieceDescriptors, which would tell us the unicode status. Since a character run only has one unicode status, might it make sense to allow controlled access to PieceDescriptor.isUnicode() on the underlying TextPiece (I'm assuming a character run only has the one text piece?) You could then itterate over the intermedia CharacterRuns, and figure out the byte <--> character count mapping for your range of interest Nicik --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
