]> source.dussan.org Git - poi.git/commitdiff
64261 -- fix handling of drop down list when items are selected
authorTim Allison <tallison@apache.org>
Tue, 31 Mar 2020 18:16:09 +0000 (18:16 +0000)
committerTim Allison <tallison@apache.org>
Tue, 31 Mar 2020 18:16:09 +0000 (18:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1875956 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
test-data/spreadsheet/64261.xls [new file with mode: 0644]

index e2f7e045a8630167560f796a56e8d980acc25e45..1c17f48f4f23ebd48981deefba2bf146cc2ca88d 100644 (file)
@@ -165,7 +165,7 @@ public class LbsDataSubRecord extends SubRecord {
 
         // From [MS-XLS].pdf 2.5.147 FtLbsData:
         // This array MUST exist if and only if the wListType field is not equal to 0.
-        if(((_flags >> 4) & 0x2) != 0) {
+        if(((_flags >> 4) & 0x1) + (_flags >> 5 & 0x1) != 0) {
             _bsels = new boolean[_cLines];
             for(int i=0; i < _cLines; i++) {
                 _bsels[i] = in.readByte() == 1;
index 9bcde6ed37e87bf6cda3ad1cc24f4ea09482a187..cd2bfe32bc0eddf288146a4d5990907ef19b2a51 100644 (file)
@@ -2891,7 +2891,10 @@ public final class TestBugs extends BaseTestBugzillaIssues {
     public void test63940() throws IOException {
         simpleTest("SUBSTITUTE.xls");
     }
-
+    @Test
+    public void test64261() throws IOException {
+        simpleTest("64261.xls");
+    }
     // a simple test which rewrites the file once and evaluates its formulas
     private void simpleTest(String fileName) throws IOException {
         simpleTest(fileName, null);
@@ -2932,4 +2935,6 @@ public final class TestBugs extends BaseTestBugzillaIssues {
         HSSFFormulaEvaluator.setupEnvironment( files.toArray(new String[0]), evals.toArray(new HSSFFormulaEvaluator[0]) );
         evals.get(0).evaluateAll();
     }
+
+
 }
diff --git a/test-data/spreadsheet/64261.xls b/test-data/spreadsheet/64261.xls
new file mode 100644 (file)
index 0000000..83d9465
Binary files /dev/null and b/test-data/spreadsheet/64261.xls differ