From: Nick Burch Date: Mon, 3 Mar 2008 15:26:38 +0000 (+0000) Subject: Patch from Josh from bug #44495 - Handle named cell ranges in formulas that have... X-Git-Tag: REL_3_0_3_BETA1~112 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d27a72a6038af596a9e1ea212dc62058a6100f3f;p=poi.git Patch from Josh from bug #44495 - Handle named cell ranges in formulas that have lower case parts git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@633126 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index f043de44b6..d85e3a3a71 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -36,6 +36,7 @@ + 44495 - Handle named cell ranges in formulas that have lower case parts 44491 - Don't have the new-style "HPSF properties are always available" affect the old-style use of HPSF alongside HSSF 44471 - Crystal Reports generates files with short StyleRecords, which isn't allowed in the spec. Work around this 44450 - Support for Lookup, HLookup and VLookup functions diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 66c348de6a..4b836f6a96 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -33,6 +33,7 @@ + 44495 - Handle named cell ranges in formulas that have lower case parts 44491 - Don't have the new-style "HPSF properties are always available" affect the old-style use of HPSF alongside HSSF 44471 - Crystal Reports generates files with short StyleRecords, which isn't allowed in the spec. Work around this 44450 - Support for Lookup, HLookup and VLookup functions diff --git a/src/java/org/apache/poi/hssf/model/FormulaParser.java b/src/java/org/apache/poi/hssf/model/FormulaParser.java index 1d78b1b239..dc75a5c170 100644 --- a/src/java/org/apache/poi/hssf/model/FormulaParser.java +++ b/src/java/org/apache/poi/hssf/model/FormulaParser.java @@ -327,7 +327,7 @@ public class FormulaParser { for(int i = 0; i < book.getNumNames(); i++) { // Our formula will by now contain an upper-cased // version of any named range names - if(book.getNameRecord(i).getNameText().toUpperCase().equals(name)) { + if(book.getNameRecord(i).getNameText().equalsIgnoreCase(name)) { nameRecordExists = true; } } diff --git a/src/java/org/apache/poi/hssf/record/formula/NamePtg.java b/src/java/org/apache/poi/hssf/record/formula/NamePtg.java index d418afa7e7..01323c3a01 100644 --- a/src/java/org/apache/poi/hssf/record/formula/NamePtg.java +++ b/src/java/org/apache/poi/hssf/record/formula/NamePtg.java @@ -50,7 +50,7 @@ public class NamePtg NameRecord rec; for (short i = 1; i < n; i++) { rec = book.getNameRecord(i - 1); - if (name.equals(rec.getNameText())) { + if (name.equalsIgnoreCase(rec.getNameText())) { field_1_label_index = i; return; }