[ 
https://issues.apache.org/jira/browse/ODFTOOLKIT-362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13723488#comment-13723488
 ] 

Jörg Büsse commented on ODFTOOLKIT-362:
---------------------------------------

replace(String) in 0.6.1-incubating-rc3 works fine and the loop is gone
Also the formatting is maintained, with some minor flaws. I've made a new test 
template and replaced my patterns. I formated <<ONE>> using a bold font.

a[bold]<<ONE>>[/bold]b
c<<TWO>>d

It seems that the </text:span> element from the text "a" move behind the text 
pattern "<<ONE>>". The replacement was done with the same code as initially 
provided in the OdfBug.java only the template was modified and the text pattern 
"<<ONE>>" was formated "bold"

old: <text:p text:style-name="P3"><text:span 
text:style-name="T5">a</text:span><text:span 
text:style-name="T1"><<ONE>></text:span>            <text:span 
text:style-name="T5">b</text:span></text:p>
new: <text:p text:style-name="P3"><text:span text:style-name="T5">a            
<text:span                     ><<<1>>></text:span></text:span><text:span 
text:style-name="T5">b</text:span></text:p>
old: <text:p text:style-name="P3"><text:span text:style-name="T5">c</text:span> 
          <<TWO>>                        <text:span 
text:style-name="T5">d</text:span></text:p>
new: <text:p text:style-name="P3"><text:span text:style-name="T5">c            
<text:span><<<2>>></text:span></text:span><text:span 
text:style-name="T5">d</text:span></text:p>

                
> 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, 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