From: Yegor Kozlov Date: Wed, 25 Jul 2012 15:45:09 +0000 (+0000) Subject: Bugzilla 53205 - Fix some parsing errors and encoding issues in HDGF X-Git-Tag: 3.10-beta1~166 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=302a48a25b5bffb93233438936cb87943383a9c9;p=poi.git Bugzilla 53205 - Fix some parsing errors and encoding issues in HDGF git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1365638 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 4e5d4384dc..0602dfd241 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 53205 - Fix some parsing errors and encoding issues in HDGF 53204 - Improved performanceof PageSettingsBlock in HSSF 53500 - Getter for repeating rows and columns 53369 - Fixed tests failing on JDK 1.7 diff --git a/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java b/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java index fc880d5db3..b2a42536c3 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java @@ -161,70 +161,76 @@ public final class Chunk { continue; } - // Process - switch(type) { - // Types 0->7 = a flat at bit 0->7 - case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: - int val = contents[offset] & (1< 0); - break; - case 8: - command.value = Byte.valueOf(contents[offset]); - break; - case 9: - command.value = new Double( - LittleEndian.getDouble(contents, offset) - ); - break; - case 12: - // A Little Endian String - // Starts 8 bytes into the data segment - // Ends at end of data, or 00 00 - - // Ensure we have enough data - if(contents.length < 8) { - command.value = ""; + try { + // Process + switch(type) { + // Types 0->7 = a flat at bit 0->7 + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: + int val = contents[offset] & (1< 0); break; - } - - // Find the end point - int startsAt = 8; - int endsAt = startsAt; - for(int j=startsAt; j