Rename EscherRecordHolder to OfficeArtContent

While the class does indeed hold EscherRecords, due to recent refactoring it is much more structured now than it was before. The contents of the class now closely resemble the OfficeArtContent structure referenced in the MS-DOC spec. Naming the class after the specification structure makes it easier to find and understand.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887009 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java b/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java
index 3e1de7c..6571c65 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java
@@ -31,7 +31,6 @@
 import org.apache.poi.hwpf.model.CHPBinTable;
 import org.apache.poi.hwpf.model.ComplexFileTable;
 import org.apache.poi.hwpf.model.DocumentProperties;
-import org.apache.poi.hwpf.model.EscherRecordHolder;
 import org.apache.poi.hwpf.model.FSPADocumentPart;
 import org.apache.poi.hwpf.model.FSPATable;
 import org.apache.poi.hwpf.model.FieldsTables;
@@ -39,6 +38,7 @@
 import org.apache.poi.hwpf.model.ListTables;
 import org.apache.poi.hwpf.model.NoteType;
 import org.apache.poi.hwpf.model.NotesTables;
+import org.apache.poi.hwpf.model.OfficeArtContent;
 import org.apache.poi.hwpf.model.PAPBinTable;
 import org.apache.poi.hwpf.model.PicturesTable;
 import org.apache.poi.hwpf.model.RevisionMarkAuthorTable;
@@ -134,9 +134,9 @@
     private FSPATable _fspaMain;
 
     /**
-     * Escher Drawing Group information
+     * Office Art (Escher records) information
      */
-    private EscherRecordHolder _escherRecordHolder;
+    private final OfficeArtContent officeArtContent;
 
     /**
      * Holds pictures table
@@ -309,14 +309,14 @@
                 FSPADocumentPart.HEADER);
         _fspaMain = new FSPATable(_tableStream, _fib, FSPADocumentPart.MAIN);
 
-        _escherRecordHolder = new EscherRecordHolder(_tableStream, _fib.getFcDggInfo(), _fib.getLcbDggInfo());
+        officeArtContent = new OfficeArtContent(_tableStream, _fib.getFcDggInfo(), _fib.getLcbDggInfo());
 
         // read in the pictures stream
-        _pictures = new PicturesTable(this, _dataStream, _mainStream, _fspaMain, _escherRecordHolder);
+        _pictures = new PicturesTable(this, _dataStream, _mainStream, _fspaMain, officeArtContent);
 
         // And escher pictures
-        _officeDrawingsHeaders = new OfficeDrawingsImpl(_fspaHeaders, _escherRecordHolder, _mainStream);
-        _officeDrawingsMain = new OfficeDrawingsImpl(_fspaMain, _escherRecordHolder, _mainStream);
+        _officeDrawingsHeaders = new OfficeDrawingsImpl(_fspaHeaders, officeArtContent, _mainStream);
+        _officeDrawingsMain = new OfficeDrawingsImpl(_fspaMain, officeArtContent, _mainStream);
 
         _st = new SectionTable(_mainStream, _tableStream, _fib.getFcPlcfsed(), _fib.getLcbPlcfsed(), fcMin, _tpt, _fib.getSubdocumentTextStreamLength(SubdocumentType.MAIN));
         _ss = new StyleSheet(_tableStream, _fib.getFcStshf());
@@ -513,8 +513,8 @@
     }
 
     @Internal
-    public EscherRecordHolder getEscherRecordHolder() {
-        return _escherRecordHolder;
+    public OfficeArtContent getOfficeArtContent() {
+        return officeArtContent;
     }
 
     public OfficeDrawings getOfficeDrawingsHeaders() {
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java b/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java
index 0c8bcf5..6d48748 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java
@@ -64,7 +64,6 @@
 import org.apache.poi.poifs.filesystem.Entry;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.util.Beta;
-import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.LittleEndian;
 
 /**
@@ -367,7 +366,7 @@
             return;
         }
 
-        System.out.println( ( (HWPFDocument) _doc ).getEscherRecordHolder() );
+        System.out.println( ( (HWPFDocument) _doc ).getOfficeArtContent() );
     }
 
     public void dumpFIB() {
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java b/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java
index f002f3b..e03c296 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java
@@ -1005,7 +1005,7 @@
     }
 
     /**
-     * @return Offset in the Table Stream at which the {@link EscherRecordHolder} exists.
+     * @return Offset in the Table Stream at which the {@link OfficeArtContent} exists.
      */
     public int getFcDggInfo()
     {
@@ -1013,11 +1013,11 @@
     }
 
     /**
-     * Returns the size, in bytes, of the {@link EscherRecordHolder} at the offset {@link #getFcDggInfo()}.
+     * Returns the size, in bytes, of the {@link OfficeArtContent} at the offset {@link #getFcDggInfo()}.
      * <p>
      * If {@code 0}, there MUST NOT be any drawings in the document.
      *
-     * @return Size, in bytes, of the {@link EscherRecordHolder} at the offset {@link #getFcDggInfo()}.
+     * @return Size, in bytes, of the {@link OfficeArtContent} at the offset {@link #getFcDggInfo()}.
      */
     public int getLcbDggInfo()
     {
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/EscherRecordHolder.java b/src/scratchpad/src/org/apache/poi/hwpf/model/OfficeArtContent.java
similarity index 94%
rename from src/scratchpad/src/org/apache/poi/hwpf/model/EscherRecordHolder.java
rename to src/scratchpad/src/org/apache/poi/hwpf/model/OfficeArtContent.java
index 8d5c392..4967c54 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/model/EscherRecordHolder.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OfficeArtContent.java
@@ -31,12 +31,14 @@
 import static org.apache.logging.log4j.util.Unbox.box;
 
 /**
- * Based on AbstractEscherRecordHolder from HSSF.
+ * Information about drawings in the document.
+ * <p>
+ * The {@code delay stream} referenced in {@code [MS-ODRAW]} is the {@code WordDocument} stream.
  *
  * @author Squeeself
  */
 @Internal
-public final class EscherRecordHolder {
+public final class OfficeArtContent {
 
 	/**
 	 * {@link EscherRecordTypes#DGG_CONTAINER} containing drawing group information for the document.
@@ -59,7 +61,7 @@
 	 */
 	private EscherContainerRecord headerDocumentDgContainer;
 
-	public EscherRecordHolder(byte[] data, int offset, int size) {
+	public OfficeArtContent(byte[] data, int offset, int size) {
 		fillEscherRecords(data, offset, size);
 	}
 
@@ -107,7 +109,7 @@
 					headerDocumentDgContainer = dgContainer;
 					break;
 				default:
-					LogManager.getLogger(EscherRecordHolder.class).atWarn()
+					LogManager.getLogger(OfficeArtContent.class).atWarn()
 							.log("dgglbl {} for OfficeArtWordDrawing is out of bounds [0, 1]", box(dgglbl));
 			}
 		}
@@ -180,7 +182,7 @@
 
 	@Override
 	public String toString() {
-		return "EscherRecordHolder{" +
+		return "OfficeArtContent{" +
 				"drawingGroupData=" + drawingGroupData +
 				", mainDocumentDgContainer=" + mainDocumentDgContainer +
 				", headerDocumentDgContainer=" + headerDocumentDgContainer +
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PicturesTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PicturesTable.java
index c5e8e0d..b74c155 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/model/PicturesTable.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PicturesTable.java
@@ -72,7 +72,7 @@
   @Deprecated
   private FSPATable _fspa;
   @Deprecated
-  private EscherRecordHolder _dgg;
+  private OfficeArtContent _dgg;
 
   /** @link dependency
    * @stereotype instantiate*/
@@ -84,7 +84,7 @@
    * @param _dataStream
    */
   @Deprecated
-  public PicturesTable(HWPFDocument _document, byte[] _dataStream, byte[] _mainStream, FSPATable fspa, EscherRecordHolder dgg)
+  public PicturesTable(HWPFDocument _document, byte[] _dataStream, byte[] _mainStream, FSPATable fspa, OfficeArtContent dgg)
   {
     this._document = _document;
     this._dataStream = _dataStream;
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java
index c71ed6c..0dcb388 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java
@@ -32,27 +32,27 @@
 import org.apache.poi.ddf.EscherSimpleProperty;
 import org.apache.poi.ddf.EscherSpRecord;
 import org.apache.poi.ddf.EscherTertiaryOptRecord;
-import org.apache.poi.hwpf.model.EscherRecordHolder;
 import org.apache.poi.hwpf.model.FSPA;
 import org.apache.poi.hwpf.model.FSPATable;
+import org.apache.poi.hwpf.model.OfficeArtContent;
 
 public class OfficeDrawingsImpl implements OfficeDrawings
 {
-    private final EscherRecordHolder _escherRecordHolder;
+    private final OfficeArtContent officeArtContent;
     private final FSPATable _fspaTable;
     private final byte[] _mainStream;
 
-    public OfficeDrawingsImpl( FSPATable fspaTable,
-            EscherRecordHolder escherRecordHolder, byte[] mainStream )
+    public OfficeDrawingsImpl(FSPATable fspaTable,
+                              OfficeArtContent officeArtContent, byte[] mainStream )
     {
         this._fspaTable = fspaTable;
-        this._escherRecordHolder = escherRecordHolder;
+        this.officeArtContent = officeArtContent;
         this._mainStream = mainStream;
     }
 
     private EscherBlipRecord getBitmapRecord( int bitmapIndex )
     {
-        List<? extends EscherContainerRecord> bContainers = _escherRecordHolder
+        List<? extends EscherContainerRecord> bContainers = officeArtContent
                 .getBStoreContainers();
         if ( bContainers == null || bContainers.size() != 1 )
             return null;
@@ -105,7 +105,7 @@
     private EscherContainerRecord getEscherShapeRecordContainer(
             final int shapeId )
     {
-        for ( EscherContainerRecord spContainer : _escherRecordHolder
+        for ( EscherContainerRecord spContainer : officeArtContent
                 .getSpContainers() )
         {
             EscherSpRecord escherSpRecord = spContainer