diff --git a/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java b/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java index 8902823373..ce83000d99 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java +++ b/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java @@ -47,7 +47,7 @@ public class SlideShowRecordDumper public static void main(String args[]) throws IOException { if(args.length == 0) { - System.err.println("Useage: SlideShowDumper "); + System.err.println("Useage: SlideShowRecordDumper "); return; } diff --git a/src/scratchpad/src/org/apache/poi/hslf/dev/UserEditAndPersistListing.java b/src/scratchpad/src/org/apache/poi/hslf/dev/UserEditAndPersistListing.java index 5fff3fa03b..72b26de520 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/dev/UserEditAndPersistListing.java +++ b/src/scratchpad/src/org/apache/poi/hslf/dev/UserEditAndPersistListing.java @@ -22,7 +22,14 @@ package org.apache.poi.hslf.dev; import org.apache.poi.hslf.*; import org.apache.poi.hslf.record.*; +import org.apache.poi.poifs.filesystem.POIFSFileSystem; +import org.apache.poi.poifs.filesystem.POIFSDocument; +import org.apache.poi.poifs.filesystem.DocumentEntry; +import org.apache.poi.poifs.filesystem.DocumentInputStream; +import org.apache.poi.util.LittleEndian; + import java.io.*; +import java.util.Hashtable; /** * Uses record level code to locate UserEditAtom records, and other @@ -30,13 +37,18 @@ import java.io.*; * illuminate quite what all the offsets mean */ public class UserEditAndPersistListing { + private static byte[] fileContents; + public static void main(String[] args) throws Exception { if(args.length < 1) { System.err.println("Need to give a filename"); System.exit(1); } + + // Create the slideshow object, for normal working with HSLFSlideShow ss = new HSLFSlideShow(args[0]); + fileContents = ss.getUnderlyingBytes(); System.out.println(""); // Find any persist ones first @@ -52,6 +64,26 @@ public class UserEditAndPersistListing { if(r.getRecordType() == 6002l) { // PersistPtrIncrementalBlock System.out.println("Found PersistPtrIncrementalBlock at " + pos + " (" + Integer.toHexString(pos) + ")"); + PersistPtrHolder pph = (PersistPtrHolder)r; + + // Check the sheet offsets + int[] sheetIDs = pph.getKnownSlideIDs(); + Hashtable sheetOffsets = pph.getSlideLocationsLookup(); + for(int j=0; j