for (int x = 0; x < itcMac; x++)
{
- if(hasTCs) rgtc[x] = TableCellDescriptor.convertBytesToTC(grpprl,
- offset + (1 + ( (itcMac + 1) * 2) + (x * 20)));
+ // Sometimes, the grpprl does not contain data at every offset. I have no idea why this happens.
+ if(hasTCs && offset + (1 + ( (itcMac + 1) * 2) + (x * 20)) < grpprl.length)
+ rgtc[x] = TableCellDescriptor.convertBytesToTC(grpprl,
+ offset + (1 + ( (itcMac + 1) * 2) + (x * 20)));
else
rgtc[x] = new TableCellDescriptor();
}
Section s = r.getSection(x);
for (int y = 0; y < s.numParagraphs(); y++) {
Paragraph paragraph = s.getParagraph(y);
- System.out.println(paragraph.getCharacterRun(0).text());
+ //System.out.println(paragraph.getCharacterRun(0).text());
}
}
}
+
+ /**
+ * AIOOB for TableSprmUncompressor.unCompressTAPOperation
+ */
+ public void testSprmAIOOB() throws Exception {
+ HWPFDocument doc = new HWPFDocument(new FileInputStream(dirname + "/AIOOB-Tap.doc"));
+
+ Range r = doc.getRange();
+ StyleSheet styleSheet = doc.getStyleSheet();
+ for (int x = 0; x < r.numSections(); x++) {
+ Section s = r.getSection(x);
+ for (int y = 0; y < s.numParagraphs(); y++) {
+ Paragraph paragraph = s.getParagraph(y);
+ //System.out.println(paragraph.getCharacterRun(0).text());
+ }
+ }
+ }
}