From 10cf53ec200877d2b5850b7790870656775b8124 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Mon, 17 Sep 2007 16:34:48 +0000 Subject: [PATCH] Convert to use POIDocument 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java b/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java index 14c988ac80..955cbc5ab4 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java @@ -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)) { -- 2.39.5