for (int y = 0; y < fkpSize; y++)
{
- _textRuns.add(cfkp.getCHPX(y));
+ CHPX chpx = cfkp.getCHPX(y);
+ if (chpx != null && tpt.isIndexInTable( chpx.getStartBytes(), chpx.getEndBytes() ))
+ _textRuns.add(chpx);
}
}
Collections.sort( _textRuns, PropertyNode.StartComparator.instance );
for (int y = 0; y < fkpSize; y++)
{
PAPX papx = pfkp.getPAPX(y);
- _paragraphs.add(papx);
+ if (papx != null && tpt.isIndexInTable( papx.getStartBytes(), papx.getEndBytes() ))
+ _paragraphs.add(papx);
}
}
Collections.sort( _paragraphs, PropertyNode.StartComparator.instance );
int startAt = node.getStart();
int endAt = node.getEnd();
+ SEPX sepx;
// check for the optimization
if (fileOffset == 0xffffffff)
{
- _sections.add(new SEPX(sed, startAt, endAt, charConv, new byte[0]));
+ sepx = new SEPX(sed, startAt, endAt, charConv, new byte[0]);
}
else
{
byte[] buf = new byte[sepxSize+2];
fileOffset += LittleEndian.SHORT_SIZE;
System.arraycopy(documentStream, fileOffset, buf, 0, buf.length);
- _sections.add(new SEPX(sed, startAt, endAt, charConv, buf));
+ sepx = new SEPX(sed, startAt, endAt, charConv, buf);
}
+
+ if (tpt.isIndexInTable( sepx.getStartBytes(), sepx.getEndBytes() ))
+ _sections.add(sepx);
}
Collections.sort( _sections, PropertyNode.StartComparator.instance );
}