]> source.dussan.org Git - poi.git/commitdiff
Avoid IllegalStateException when creating Data validation in sheet with macro, see...
authorYegor Kozlov <yegor@apache.org>
Mon, 4 Oct 2010 08:45:51 +0000 (08:45 +0000)
committerYegor Kozlov <yegor@apache.org>
Mon, 4 Oct 2010 08:45:51 +0000 (08:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1004143 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/java/org/apache/poi/hssf/model/RecordOrderer.java
src/java/org/apache/poi/hssf/record/UnknownRecord.java
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
test-data/spreadsheet/50020.xls [new file with mode: 0644]

index 27aa73f5fd2165115ae52e65a7793f1c62b48d03..94337a2b84b502ff4f7395d7a3cd1b0530a3e5d3 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.7-beta4" date="2010-??-??">
+           <action dev="poi-developers" type="fix">50020 - Avoid IllegalStateException when creating Data validation in sheet with macro</action>
            <action dev="poi-developers" type="fix">50033 - Improved rounding in MOD</action>
            <action dev="poi-developers" type="add">Generate SHA1 hashes of distribution files, alongside existing MD5 ones</action>
         </release>
index 31c25db8502780fe8c0d1597f0410fb1997fb10b..b7d942e5dcad1b0156a197129b003ae22bcda2f9 100644 (file)
@@ -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;
index 3e04d0f8bf96db73ca10a9b0f3c0711daa15bb34..963810f745ddc539dc370752692b9ac8859fd46a 100644 (file)
@@ -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;
index 7c83d0b4a146c6c70d8a8d82b788375434220f9d..a851ba15ae278e96c26752d7c3e8e38c668aad10 100644 (file)
@@ -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 (file)
index 0000000..9f4001e
Binary files /dev/null and b/test-data/spreadsheet/50020.xls differ