]> source.dussan.org Git - poi.git/commitdiff
Patch from bug #45003 - Support embeded HDGF visio documents
authorNick Burch <nick@apache.org>
Tue, 20 May 2008 17:17:16 +0000 (17:17 +0000)
committerNick Burch <nick@apache.org>
Tue, 20 May 2008 17:17:16 +0000 (17:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@658352 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/changes.xml
src/documentation/content/xdocs/status.xml
src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java

index 824713479c4f180d0ccdb8ad2e0fe246cca37987..5c26883bab9320682d671faf261b4559b506984a 100644 (file)
@@ -37,6 +37,7 @@
 
                <!-- Don't forget to update status.xml too! -->
         <release version="3.1-final" date="2008-06-??">
+           <action dev="POI-DEVELOPERS" type="add">45003 - Support embeded HDGF visio documents</action>
            <action dev="POI-DEVELOPERS" type="fix">45001 - Partial fix for HWPF Range.insertBefore() and Range.delete() with unicode characters</action>
            <action dev="POI-DEVELOPERS" type="fix">44977 - Support for AM/PM in excel date formats</action>
            <action dev="POI-DEVELOPERS" type="add">Support for specifying a policy to HSSF on missing / blank cells when fetching</action>
index 12bdd0dd9fbabe36b19736fcd151647e1ad20076..6706d409e181adce832e453f7df2ceb631f46a7f 100644 (file)
@@ -34,6 +34,7 @@
        <!-- Don't forget to update changes.xml too! -->
     <changes>
         <release version="3.1-final" date="2008-06-??">
+           <action dev="POI-DEVELOPERS" type="add">45003 - Support embeded HDGF visio documents</action>
            <action dev="POI-DEVELOPERS" type="fix">45001 - Partial fix for HWPF Range.insertBefore() and Range.delete() with unicode characters</action>
            <action dev="POI-DEVELOPERS" type="fix">44977 - Support for AM/PM in excel date formats</action>
            <action dev="POI-DEVELOPERS" type="add">Support for specifying a policy to HSSF on missing / blank cells when fetching</action>
index 0f1ac882cc81a13417266947cad187ff689927b4..764b8e3f5ff60f655f8b76d6380dc51db4b2fab3 100644 (file)
@@ -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();