import org.apache.poi.util.LittleEndian;
-public class FIBLongHandler
-{
+/**
+ * Handles the fibRgLw / The FibRgLw97 part of
+ * the FIB (File Information Block)
+ */
+public class FIBLongHandler {
public static final int CBMAC = 0;
public static final int PRODUCTCREATED = 1;
public static final int PRODUCTREVISED = 2;
import org.apache.poi.util.LittleEndian;
-import org.apache.poi.hwpf.model.io.HWPFOutputStream;
-
-class FIBShortHandler
-{
+/**
+ * Handles the fibRgW / FibRgW97 part of
+ * the FIB (File Information Block)
+ */
+public class FIBShortHandler {
public final static int MAGICCREATED = 0;
public final static int MAGICREVISED = 1;
public final static int MAGICCREATEDPRIVATE = 2;
import org.apache.poi.hwpf.model.types.FIBAbstractType;
/**
- *
+ * The File Information Block (FIB). Holds pointers
+ * to various bits of the file, and lots of flags which
+ * specify properties of the document.
+ *
+ * The parent class, {@link FIBAbstractType}, holds the
+ * first 32 bytes, which make up the FibBase.
+ * The next part, the fibRgW / FibRgW97, is handled
+ * by {@link FIBShortHandler}.
+ * The next part, the fibRgLw / The FibRgLw97, is
+ * handled by the {@link FIBLongHandler}.
+ * Finally, the rest of the fields are handled by
+ * the {@link FIBFieldHandler}.
+ *
* @author andy
*/
public class FileInformationBlock extends FIBAbstractType
import org.apache.poi.hwpf.usermodel.*;
/**
- * File information Block.
+ * Base part of the File information Block (FibBase). Holds the core part of the FIB, from the first 32 bytes.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* remove the record in src/records/definitions.
HWPFDocument daDoc = new HWPFDocument(new FileInputStream(illustrativeDocFile));
- Range range = daDoc.getRange();
+ Range range = daDoc.getOverallRange();
assertEquals(1, range.numSections());
Section section = range.getSection(0);
assertEquals(5, para.numCharacterRuns());
assertEquals(originalText, para.text());
+
+
+ // Now check on just the main text
+ range = daDoc.getRange();
+
+ assertEquals(1, range.numSections());
+ section = range.getSection(0);
+
+ assertEquals(5, section.numParagraphs());
+ para = section.getParagraph(2);
+
+ assertEquals(5, para.numCharacterRuns());
+
+ assertEquals(originalText, para.text());
}
/**
HWPFDocument daDoc = new HWPFDocument(new FileInputStream(illustrativeDocFile));
- Range range = daDoc.getRange();
+ Range range = daDoc.getOverallRange();
assertEquals(1, range.numSections());
Section section = range.getSection(0);
<record fromfile="true" name="FIB" package="org.apache.poi.hwpf.model.types">
<suffix>AbstractType</suffix>
<extends>HDFType</extends>
- <description>File information Block.</description>
+ <description>Base part of the File information Block (FibBase). Holds the core part of the FIB, from the first 32 bytes.</description>
<author>Andrew C. Oliver</author>
<fields>
<!-- <field type="int" size="2" name="format flags">