From 597672166046577a2afd59987004d96ff9d75f18 Mon Sep 17 00:00:00 2001 From: Tim Allison Date: Tue, 31 Mar 2020 18:16:09 +0000 Subject: [PATCH] 64261 -- fix handling of drop down list when items are selected git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1875956 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hssf/record/LbsDataSubRecord.java | 2 +- .../org/apache/poi/hssf/usermodel/TestBugs.java | 7 ++++++- test-data/spreadsheet/64261.xls | Bin 0 -> 26624 bytes 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 test-data/spreadsheet/64261.xls diff --git a/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java b/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java index e2f7e045a8..1c17f48f4f 100644 --- a/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java +++ b/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java @@ -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; diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 9bcde6ed37..cd2bfe32bc 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -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 index 0000000000000000000000000000000000000000..83d946547602cae74cd9f9519cf614e47d273bb9 GIT binary patch literal 26624 zcmeHQ2|QKX_uu!rxWq%GP~2q9JjHto(I`WMrdQI9OG*^dD4Oe4l4iUn4XW3q)T@-r zYY-YlB~4Pj`l+Z_(RlxBo#S%n_)nkzVEgPdth4ubt-bczYY%6i>&A7h$J>wSR}rz` zK@`Y$z6wziqBG#yQE;zG;5naR@hMCFGVsz1PBl8!$}!2pYt zS97R!6*(9jvJF!3lLTd9Glmf!*hUN-Ib=8)NDNs{L=og*bR*WJ8~oWrqvsG~@(0J5 zxWly#&?KK2vU-7I=qxMS7%~(%gppu50G>pdbP)!y1>W+wi$6DH4FvTV%ZHF9i6q!G z(j9D^5dtOd4jPbFYJ5iPM1BeZhB2f!7Sbo3ACF!HkA^I3VoA&i39;$U>1N%nn|+9l z`&glCq#N5912x3PE5yc-H6QB2LzQ(%he z^H}2()>cvdH_;Etpf8s}PnSW@kU`%kgZ_sMx-5A%$Vk6m23;1utn^1@;QUw1bCTk# z3e`llm!^85^`;@9uhY`n*luGx!lLz{)kF^u&o|09BCHb>4vh3@oH8;VF7;t#MbVX; z>4V|YNI+K+(8bzg2LZiFp0gB=Bt2IKot8&3{ZSd|Y5hy4r}d*Qkf%uxbiK3_(3|8u zK;bKb=c4r4012odXcv|;=+-jm-KEmi08_NS#Ox|lOG~$%F4UKxy{JgV`AL8S<)Z76 zuHW_ox>&tv%b?>Nj*>?#Jq-0}dKtlb*OjREGISovodk59=JZ@bJSaPv%hn-t5vVD6 zkSgvFt3p0A1Tp;Q5)788At!GSGwDR&YQ;TE&6Y+6>sG zwTc7QRjV>6w>AS-N~<`a8)#Jq^jEFQfDN@(8L)-5Dg(NRR%O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