diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 27aa73f5f..94337a2b8 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 50020 - Avoid IllegalStateException when creating Data validation in sheet with macro 50033 - Improved rounding in MOD Generate SHA1 hashes of distribution files, alongside existing MD5 ones diff --git a/src/java/org/apache/poi/hssf/model/RecordOrderer.java b/src/java/org/apache/poi/hssf/model/RecordOrderer.java index 31c25db85..b7d942e5d 100644 --- a/src/java/org/apache/poi/hssf/model/RecordOrderer.java +++ b/src/java/org/apache/poi/hssf/model/RecordOrderer.java @@ -333,6 +333,8 @@ final class RecordOrderer { // ConditionalFormattingTable case HyperlinkRecord.sid: case UnknownRecord.QUICKTIP_0800: + // name of a VBA module + case UnknownRecord.CODENAME_1BA: return true; } return false; diff --git a/src/java/org/apache/poi/hssf/record/UnknownRecord.java b/src/java/org/apache/poi/hssf/record/UnknownRecord.java index 3e04d0f8b..963810f74 100644 --- a/src/java/org/apache/poi/hssf/record/UnknownRecord.java +++ b/src/java/org/apache/poi/hssf/record/UnknownRecord.java @@ -57,6 +57,7 @@ public final class UnknownRecord extends StandardRecord { public static final int SHEETEXT_0862 = 0x0862; // OOO calls this SHEETLAYOUT public static final int SHEETPROTECTION_0867 = 0x0867; public static final int HEADER_FOOTER_089C = 0x089C; + public static final int CODENAME_1BA = 0x01BA; private int _sid; private byte[] _rawData; diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 7c83d0b4a..a851ba15a 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -1886,4 +1886,12 @@ if(1==2) { "BlahBlah blah blah ", f.getCenter() ); } + + /** + * IllegalStateException received when creating Data validation in sheet with macro + */ + public void test50020() throws Exception { + HSSFWorkbook wb = openSample("50020.xls"); + writeOutAndReadBack(wb); + } } diff --git a/test-data/spreadsheet/50020.xls b/test-data/spreadsheet/50020.xls new file mode 100644 index 000000000..9f4001ef2 Binary files /dev/null and b/test-data/spreadsheet/50020.xls differ