Start to document the whole FIB stuff better

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@684287 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2008-08-09 16:24:20 +00:00
parent ab4e96f84d
commit 75d7409d0d
6 changed files with 41 additions and 11 deletions

View File

@ -22,8 +22,11 @@ import java.io.IOException;
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;

View File

@ -22,10 +22,11 @@ import java.io.IOException;
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;

View File

@ -28,6 +28,18 @@ import org.apache.poi.hwpf.model.io.*;
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
*/

View File

@ -31,7 +31,7 @@ import org.apache.poi.hdf.model.hdftypes.HDFType;
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.

View File

@ -67,7 +67,7 @@ public class TestRangeDelete extends TestCase {
HWPFDocument daDoc = new HWPFDocument(new FileInputStream(illustrativeDocFile));
Range range = daDoc.getRange();
Range range = daDoc.getOverallRange();
assertEquals(1, range.numSections());
Section section = range.getSection(0);
@ -78,6 +78,20 @@ public class TestRangeDelete extends TestCase {
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());
}
/**
@ -87,7 +101,7 @@ public class TestRangeDelete extends TestCase {
HWPFDocument daDoc = new HWPFDocument(new FileInputStream(illustrativeDocFile));
Range range = daDoc.getRange();
Range range = daDoc.getOverallRange();
assertEquals(1, range.numSections());
Section section = range.getSection(0);

View File

@ -20,7 +20,7 @@
<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">