Open GoogleCodeExporter opened 9 years ago
I found this issue too. I've worked around it by adding sanity checks to the
bounds.
See the code below - the stuff I added is commented
for (int x = 0; x < textRuns.size(); x++)
{
CHPX chpx = (CHPX)textRuns.get(x);
if (!isDeleted(chpx.getGrpprl()))
{
/**
* Begin Sanity checks
* 1. If end > length force end == length
* 2. if start > end or start > length, skip
*/
int end = (chpx.getEnd()>allTxt.length()) ? allTxt.length() : chpx.getEnd();
if ((chpx.getStart()>chpx.getEnd()) || (chpx.getStart()>allTxt.length())) continue;
/**
* End sanity checks
*/
String str = allTxt.substring(chpx.getStart(), end);
scrubber.append(stringWriter, str);
}
}
Original comment by mikebel...@gmail.com
on 16 Jun 2009 at 5:27
Original issue reported on code.google.com by
dgoldenb...@yahoo.com
on 22 Apr 2008 at 4:01Attachments: