Fabio,

The current version of replaceText() forces you to re-create your range after every replacement (using HWPFDocument.getRange() or whatever).

I tested this using a slightly modified version of the HWPF.java file you attached and it works if I just add the following to your replace code:
        para.replaceText("campo1", " foi porraaaaa ", offset);
+       // rebuild the range...
+       range = doc.getRange();

There is another patch attached to bug 45252 that will allow you to work without rebuilding the range.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45252

In short:
1.  You can rebuild the range as a work-around
2. You can use the patch and it will simplify your loop to one statement

-h

On 24-Jun-2008, at 9:39 AM, [EMAIL PROTECTED] wrote:

https://issues.apache.org/bugzilla/show_bug.cgi?id=45269


Fabio Ebner <[EMAIL PROTECTED]> changed:

           What    |Removed                     |Added
---------------------------------------------------------------------- ------ CC| | [EMAIL PROTECTED]




--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi? tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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






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

Reply via email to