diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 69291355a..bfcdf5aa4 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -47,6 +47,7 @@ XSLFPowerPointExtractor support for including comment authors with comment text Converted XSLFPowerPointExtractor to use UserModel for all text extraction XSLF initial UserModel support for Notes and Comments for Slides + HSLF: support for uncompressed OLE embeddings 51678 - Extracting text from Bug51524.zip is slow diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/ExOleObjStg.java b/src/scratchpad/src/org/apache/poi/hslf/record/ExOleObjStg.java index 4fee85ead..7e6a7593b 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/ExOleObjStg.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/ExOleObjStg.java @@ -73,13 +73,21 @@ public class ExOleObjStg extends RecordAtom implements PositionDependentRecord, System.arraycopy(source,start+8,_data,0,len-8); } + public boolean isCompressed() { + return LittleEndian.getShort(_header, 0)!=0; + } + /** * Gets the uncompressed length of the data. * * @return the uncompressed length of the data. */ public int getDataLength() { - return LittleEndian.getInt(_data, 0); + if (isCompressed()) { + return LittleEndian.getInt(_data, 0); + } else { + return _data.length; + } } /** @@ -88,8 +96,12 @@ public class ExOleObjStg extends RecordAtom implements PositionDependentRecord, * @return the data input stream. */ public InputStream getData() { - InputStream compressedStream = new ByteArrayInputStream(_data, 4, _data.length); - return new InflaterInputStream(compressedStream); + if (isCompressed()) { + InputStream compressedStream = new ByteArrayInputStream(_data, 4, _data.length); + return new InflaterInputStream(compressedStream); + } else { + return new ByteArrayInputStream(_data, 0, _data.length); + } } public byte[] getRawData() {