]> source.dussan.org Git - poi.git/commitdiff
Convert to use POIDocument
authorNick Burch <nick@apache.org>
Mon, 17 Sep 2007 16:34:48 +0000 (16:34 +0000)
committerNick Burch <nick@apache.org>
Mon, 17 Sep 2007 16:34:48 +0000 (16:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@576507 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java

index 14c988ac80c6d9d228f25e2c533c6fc92d90e94c..955cbc5ab463db57e6f0078d442519134047f85c 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.poi.hdgf;
 import java.io.FileInputStream;
 import java.io.IOException;
 
+import org.apache.poi.POIDocument;
 import org.apache.poi.hdgf.chunks.ChunkFactory;
 import org.apache.poi.hdgf.pointers.Pointer;
 import org.apache.poi.hdgf.pointers.PointerFactory;
@@ -37,10 +38,9 @@ import org.apache.poi.util.LittleEndian;
  *  http://www.gnome.ru/projects/docs/slide1.png
  *  http://www.gnome.ru/projects/docs/slide2.png
  */
-public class HDGFDiagram {
+public class HDGFDiagram extends POIDocument {
        private static final String VISIO_HEADER = "Visio (TM) Drawing\r\n";
        
-       private POIFSFileSystem filesystem;
        private byte[] _docstream;
        
        private short version;
@@ -62,6 +62,9 @@ public class HDGFDiagram {
                _docstream = new byte[docProps.getSize()];
                filesystem.createDocumentInputStream("VisioDocument").read(_docstream);
                
+               // Read in the common POI streams
+               readProperties();
+               
                // Check it's really visio
                String typeString = new String(_docstream, 0, 20);
                if(! typeString.equals(VISIO_HEADER)) {