hyunsikki / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

docx preprocessing crashes when w:instrText contains ' MERGEFIELD "' #430

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When docx contains a w:instrText like this : 

--------------------------------------------------------------
<w:instrText xml:space="preserve"> MERGEFIELD "</w:instrText>
--------------------------------------------------------------

the preprocessing crashes : 

--------------------------------------------------------------
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String 
index out of range: -1
    at java.lang.String.substring(Unknown Source)
    at fr.opensagres.xdocreport.document.docx.preprocessor.sax.MergefieldBufferedRegion.getFieldName(MergefieldBufferedRegion.java:155)
--------------------------------------------------------------

See attached docx.

Original issue reported on code.google.com by angelo.z...@gmail.com on 8 Aug 2014 at 10:02

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed. See git commit at 
https://code.google.com/p/xdocreport/source/detail?r=19a7e4650ba09acc4fc52387ad3
e52c0ff8809e2

Original comment by angelo.z...@gmail.com on 8 Aug 2014 at 10:05