aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2007-08-15 14:40:02 +0000
committerNick Burch <nick@apache.org>2007-08-15 14:40:02 +0000
commit26163ce8e53ab061410cea2ff0be90322b481375 (patch)
tree4bcb4ff05d6c00d11c64ee4c87b83c07278a3a6a /src
parent9cedf7aae08640c92c8e2497c27d5ce72554cdcf (diff)
downloadpoi-26163ce8e53ab061410cea2ff0be90322b481375.tar.gz
poi-26163ce8e53ab061410cea2ff0be90322b481375.zip
Patch from Trejkaz from bug #43116 - Fix for Escher handling of embeded OLE2 documents
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@566196 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/documentation/content/xdocs/changes.xml1
-rw-r--r--src/documentation/content/xdocs/status.xml1
-rw-r--r--src/java/org/apache/poi/ddf/EscherBlipRecord.java2
-rw-r--r--src/testcases/org/apache/poi/hssf/data/ole2-embedding.xlsbin0 -> 41472 bytes
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestOLE2Embeding.java26
5 files changed, 29 insertions, 1 deletions
diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml
index 58af02a0c4..e4f8c8ecda 100644
--- a/src/documentation/content/xdocs/changes.xml
+++ b/src/documentation/content/xdocs/changes.xml
@@ -36,6 +36,7 @@
</devs>
<release version="3.0.2-FINAL" date="2007-??-??">
+ <action dev="POI-DEVELOPERS" type="fix">43116 - [PATCH] - Fix for Escher layer handling of embeded OLE2 documents</action>
<action dev="POI-DEVELOPERS" type="fix">43108 - [PATCH] - Where permissions deny fetching System Properties, use sensible defaults</action>
<action dev="POI-DEVELOPERS" type="fix">43093 - [PATCH] - Fix formula evaluator support for Area3D references to other sheets</action>
<action dev="POI-DEVELOPERS" type="fix">Improvements to HSSFDateUtils.isADateFormat, and have HSSFDateUtil.isCellDateFormatted use this</action>
diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml
index 04ee816395..bceda3644f 100644
--- a/src/documentation/content/xdocs/status.xml
+++ b/src/documentation/content/xdocs/status.xml
@@ -33,6 +33,7 @@
<changes>
<release version="3.0.2-FINAL" date="2007-??-??">
+ <action dev="POI-DEVELOPERS" type="fix">43116 - [PATCH] - Fix for Escher layer handling of embeded OLE2 documents</action>
<action dev="POI-DEVELOPERS" type="fix">43108 - [PATCH] - Where permissions deny fetching System Properties, use sensible defaults</action>
<action dev="POI-DEVELOPERS" type="fix">43093 - [PATCH] - Fix formula evaluator support for Area3D references to other sheets</action>
<action dev="POI-DEVELOPERS" type="fix">Improvements to HSSFDateUtils.isADateFormat, and have HSSFDateUtil.isCellDateFormatted use this</action>
diff --git a/src/java/org/apache/poi/ddf/EscherBlipRecord.java b/src/java/org/apache/poi/ddf/EscherBlipRecord.java
index 9ec3be30e6..2c31f3f57d 100644
--- a/src/java/org/apache/poi/ddf/EscherBlipRecord.java
+++ b/src/java/org/apache/poi/ddf/EscherBlipRecord.java
@@ -92,7 +92,7 @@ public class EscherBlipRecord
*/
public int getRecordSize()
{
- return field_pictureData.length + 4;
+ return field_pictureData.length + HEADER_SIZE;
}
/**
diff --git a/src/testcases/org/apache/poi/hssf/data/ole2-embedding.xls b/src/testcases/org/apache/poi/hssf/data/ole2-embedding.xls
new file mode 100644
index 0000000000..521082b697
--- /dev/null
+++ b/src/testcases/org/apache/poi/hssf/data/ole2-embedding.xls
Binary files differ
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestOLE2Embeding.java b/src/testcases/org/apache/poi/hssf/usermodel/TestOLE2Embeding.java
new file mode 100644
index 0000000000..b0fd77b889
--- /dev/null
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestOLE2Embeding.java
@@ -0,0 +1,26 @@
+package org.apache.poi.hssf.usermodel;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import junit.framework.TestCase;
+
+public class TestOLE2Embeding extends TestCase {
+ public void testEmbeding() throws Exception {
+ String dirname = System.getProperty("HSSF.testdata.path");
+ String filename = dirname + "/ole2-embedding.xls";
+
+ File file = new File(filename);
+ FileInputStream in = new FileInputStream(file);
+ HSSFWorkbook workbook;
+
+ // This used to break, until bug #43116 was fixed
+ workbook = new HSSFWorkbook(in);
+
+ in.close();
+
+ // Check we can get at the Escher layer still
+ workbook.getAllPictures();
+ }
+}
+