From 63f005075d77ca5a1813ce2df0a0ae151ada339f Mon Sep 17 00:00:00 2001 From: Avik Sengupta Date: Tue, 31 May 2005 19:10:47 +0000 Subject: [PATCH] bug 35084, reported by Stefano Rocca. fixed in Sheet.java git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353705 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/model/FormulaParser.java | 2 +- .../apache/poi/hssf/model/TestFormulaParser.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/poi/hssf/model/FormulaParser.java b/src/java/org/apache/poi/hssf/model/FormulaParser.java index 2141b53ed0..229aff2c89 100644 --- a/src/java/org/apache/poi/hssf/model/FormulaParser.java +++ b/src/java/org/apache/poi/hssf/model/FormulaParser.java @@ -129,7 +129,7 @@ public class FormulaParser { /** Recognize an Alpha Character */ private boolean IsAlpha(char c) { - return Character.isLetter(c) || c == '$'; + return Character.isLetter(c) || c == '$' || c=='_'; } diff --git a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java index 1e69ce0ed3..812a42d71c 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java +++ b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java @@ -388,6 +388,21 @@ public class TestFormulaParser extends TestCase { assertTrue("IntPtg",(ptgs[1] instanceof IntPtg)); assertTrue("DividePtg",(ptgs[2] instanceof DividePtg)); } + + /** bug 35027, underscore in sheet name*/ + public void testUnderscore() { + HSSFWorkbook wb = new HSSFWorkbook(); + + wb.createSheet("Cash_Flow");; + + HSSFSheet sheet = wb.createSheet("Test"); + HSSFRow row = sheet.createRow(0); + HSSFCell cell; + + cell = row.createCell((short)0); + cell.setCellFormula("Cash_Flow!A1"); + + } public static void main(String [] args) { System.out.println("Testing org.apache.poi.hssf.record.formula.FormulaParser"); -- 2.39.5