- assigned_to: nobody --> deannelson
- status: open --> open-accepted
I use the MajixBatch object to process RTF files from within ColdFusion. If the RTFAnalyser attempts to use charAt(0) when the string has a length of 0 then the whole ColdFusion service restarts.
To fix this there are two sections of code that need changing both of which are in the RTFAnalyser.java file.
Firstly,
if (_listText != null) {
should read
if ((_listText != null) && (_listText.length() > 0)) {
AND secondly, the "listtext" processor should read as follows:
_listText = getDataOfGroup().trim();
// FIX to stop the analyser dying if the string is empty
if (_listText.length() > 0) {
// TODO remove this listtext-hack here and in "pard"-parsing
// UGLY hack to determine the list type
char first = _listText.charAt(0);
if (Character.isUpperCase(first))
_theParagraphProperties.setNumStyle(RtfParagraphProperties.STYLE_NUMBERED_ALPHA_UP);
else if (Character.isLetter(first))
_theParagraphProperties.setNumStyle(RtfParagraphProperties.STYLE_NUMBERED_ALPHA);
else if (Character.isDigit(first))
_theParagraphProperties.setNumStyle(RtfParagraphProperties.STYLE_NUMBERED_DEC);
else {
_theParagraphProperties.setBullet(new Character(first).toString());
_theParagraphProperties.setNumStyle(RtfParagraphProperties.STYLE_BULLET);
}
// TODO hack: roman numbering or better: parsing of pnlevelsec
_theParagraphProperties.setBulletText(_listText);
}