/** * This constructs a CHPFormattedDiskPage from a raw fkp (512 byte array read from a Word file). */ public CHPFormattedDiskPage(byte[] documentStream, int offset, int fcMin, TextPieceTable tpt) { super(documentStream, offset); for (int x = 0; x < _crun; x++) { int startAt = getStart(x); int endAt = getEnd(x); if (!tpt.isIndexInTable(startAt) && !tpt.isIndexInTable(endAt)) { _chpxList.add(null); } else { _chpxList.add(new CHPX(startAt, endAt, tpt, getGrpprl(x))); } } }
/** Creates a PAPFormattedDiskPage from a 512 byte array */ public PAPFormattedDiskPage( byte[] documentStream, byte[] dataStream, int offset, int fcMin, TextPieceTable tpt) { super(documentStream, offset); for (int x = 0; x < _crun; x++) { int startAt = getStart(x) - fcMin; int endAt = getEnd(x) - fcMin; boolean isUnicode = tpt.isUnicodeAtByteOffset(startAt); // System.err.println(startAt + " -> " + endAt + " = " + isUnicode); _papxList.add( new PAPX(startAt, endAt, getGrpprl(x), getParagraphHeight(x), dataStream, isUnicode)); } _fkp = null; _dataStream = dataStream; }