[ 
https://issues.apache.org/jira/browse/ODFTOOLKIT-362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Florian Hopf updated ODFTOOLKIT-362:
------------------------------------

    Attachment: ODFTOOLKIT-362-test.patch

This took longer than expected but here is at least a test that reproduces the 
problem.

The problem is that in TextSelection the character count but not the node count 
is taken into account when determining where to insert the text. The new text 
will be inserted after the last non replaced character, which in this case is 
with the wrong formatting.

I am not sure if we can be correct for all cases but it should help if we just 
remember the node where we deleted the text.
                
> TextSelection.replaceWith() ends in an infinite loop
> ----------------------------------------------------
>
>                 Key: ODFTOOLKIT-362
>                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-362
>             Project: ODF Toolkit
>          Issue Type: Bug
>          Components: simple api
>    Affects Versions: odfdom-0.8.7
>            Reporter: Jörg Büsse
>             Fix For: 0.6.1-incubating
>
>         Attachments: OdfBug.java, ODFTOOLKIT-362-test.patch, testTemplate.odt
>
>
> Replacing text parts of a table cell can end in an infinite loop. We created 
> a simple class to reproduce/demonstrate the issue.
> Used libraries:
> odfdom-java-0.8.7.jar
> simple-odf-0.6.6.jar
> Also tried the libraries from odftoolkit-0.5-incubating-bin.tar.gz:
> odfdom-java-0.8.8-incubating.jar
> simple-odf-0.7-incubating.jar

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to