From: Nick Burch Date: Tue, 20 May 2008 17:17:16 +0000 (+0000) Subject: Patch from bug #45003 - Support embeded HDGF visio documents X-Git-Tag: REL_3_2_FINAL~322 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=543c4302fb99c930e9c145d6d8134055275c2c2f;p=poi.git Patch from bug #45003 - Support embeded HDGF visio documents git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@658352 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 824713479c..5c26883bab 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -37,6 +37,7 @@ + 45003 - Support embeded HDGF visio documents 45001 - Partial fix for HWPF Range.insertBefore() and Range.delete() with unicode characters 44977 - Support for AM/PM in excel date formats Support for specifying a policy to HSSF on missing / blank cells when fetching diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 12bdd0dd9f..6706d409e1 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 45003 - Support embeded HDGF visio documents 45001 - Partial fix for HWPF Range.insertBefore() and Range.delete() with unicode characters 44977 - Support for AM/PM in excel date formats Support for specifying a policy to HSSF on missing / blank cells when fetching diff --git a/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java b/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java index 0f1ac882cc..764b8e3f5f 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java @@ -28,6 +28,7 @@ import org.apache.poi.hdgf.streams.PointerContainingStream; import org.apache.poi.hdgf.streams.Stream; import org.apache.poi.hdgf.streams.StringsStream; import org.apache.poi.hdgf.streams.TrailerStream; +import org.apache.poi.poifs.filesystem.DirectoryNode; import org.apache.poi.poifs.filesystem.DocumentEntry; import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.util.LittleEndian; @@ -54,14 +55,17 @@ public class HDGFDiagram extends POIDocument { private PointerFactory ptrFactory; public HDGFDiagram(POIFSFileSystem fs) throws IOException { - super(fs); + this(fs.getRoot(), fs); + } + public HDGFDiagram(DirectoryNode dir, POIFSFileSystem fs) throws IOException { + super(dir, fs); DocumentEntry docProps = - (DocumentEntry)filesystem.getRoot().getEntry("VisioDocument"); + (DocumentEntry)dir.getEntry("VisioDocument"); // Grab the document stream _docstream = new byte[docProps.getSize()]; - filesystem.createDocumentInputStream("VisioDocument").read(_docstream); + dir.createDocumentInputStream("VisioDocument").read(_docstream); // Read in the common POI streams readProperties();