Author: nick
Date: Fri Sep 23 16:24:56 2011
New Revision: 1174868
URL: http://svn.apache.org/viewvc?rev=1174868&view=rev
Log:
Fix bug #51873 - update HSMF to ignore Outlook 2002 Olk10SideProp entries,
which don't behave like normal chunks
Modified:
poi/trunk/src/documentation/content/xdocs/status.xml
poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java
Modified: poi/trunk/src/documentation/content/xdocs/status.xml
URL:
http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=1174868&r1=1174867&r2=1174868&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Fri Sep 23 16:24:56
2011
@@ -34,6 +34,7 @@
<changes>
<release version="3.8-beta5" date="2011-??-??">
+ <action dev="poi-developers" type="fix">51873 - update HSMF to
ignore Outlook 2002 Olk10SideProp entries, which don't behave like normal
chunks</action>
<action dev="poi-developers" type="fix">51850 - support creating
comments in XSSF on an earlier slide when later ones already have them</action>
<action dev="poi-developers" type="add">51804 - optionally include
Master Slide text in XSLF text extraction, as HSLF already offers</action>
<action dev="poi-developers" type="add">New PackagePart method
getRelatedPart(PackageRelationship) to simplify navigation of relations between
OPC Parts</action>
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java?rev=1174868&r1=1174867&r2=1174868&view=diff
==============================================================================
---
poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java
(original)
+++
poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java
Fri Sep 23 16:24:56 2011
@@ -121,13 +121,23 @@ public final class POIFSChunkParser {
// Split it into its parts
int splitAt = entryName.lastIndexOf('_');
- if(splitAt == -1 || splitAt > (entryName.length()-8)) {
+ String namePrefix = entryName.substring(0, splitAt+1);
+ String ids = entryName.substring(splitAt+1);
+
+ // Make sure we got what we expected, should be of
+ // the form __<name>_<id><type>
+ if(namePrefix.equals("Olk10SideProps")) {
+ // This is some odd Outlook 2002 thing, skip
+ return;
+ } else if(splitAt <= entryName.length()-8) {
+ // In the right form for a normal chunk
+ // We'll process this further in a little bit
+ } else {
+ // Underscores not the right place, something's wrong
throw new IllegalArgumentException("Invalid chunk name " + entryName);
}
// Now try to turn it into id + type
- String namePrefix = entryName.substring(0, splitAt+1);
- String ids = entryName.substring(splitAt+1);
try {
int chunkId = Integer.parseInt(ids.substring(0, 4), 16);
int type = Integer.parseInt(ids.substring(4, 8), 16);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]