On Tue, 27 Apr 2004, Ryan Ackley wrote:
> I saw, thanks Nick. Does the delete method work?

Well, it sort of does, and sort of doesn't....


I was about to suggest that we add an example for 
adding/replacing/editing/deleting text to the HWPF examples (and possibly 
also a matching unit test)

I would be happy to code this up, but I'll need some suggestions on how 
best to acheive this.

My current (not fully working) way goes something like:

Grab the main range
Get all paragraphs
Check paragraph text for what you're interested in
If you find it in a paragraph, get Paragraph._start and the distance in to 
 your text. Then, create a new Range (child of main range) from start + 
 distance in to end of interesting text
If adding, to insertBefore / insertAfter
If deleting, just call delete on this range
If editing, call insertAfter and add your new text, then call delete on 
 the range. 

For at least some of the above, you'll need to start from scratch again, 
as your current objects seem to point to the wrong places....

Is that kinda the correct route, or am I barking up the wrong tree?

(Note that I had to make public a few protected methods and variables to 
get that to work)

Nick


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to