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
This commit is contained in:
Avik Sengupta 2005-05-31 19:10:47 +00:00
parent 99fbaec5a3
commit 26c9e21e3b
2 changed files with 16 additions and 1 deletions

View File

@ -129,7 +129,7 @@ public class FormulaParser {
/** Recognize an Alpha Character */ /** Recognize an Alpha Character */
private boolean IsAlpha(char c) { private boolean IsAlpha(char c) {
return Character.isLetter(c) || c == '$'; return Character.isLetter(c) || c == '$' || c=='_';
} }

View File

@ -389,6 +389,21 @@ public class TestFormulaParser extends TestCase {
assertTrue("DividePtg",(ptgs[2] instanceof DividePtg)); 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) { public static void main(String [] args) {
System.out.println("Testing org.apache.poi.hssf.record.formula.FormulaParser"); System.out.println("Testing org.apache.poi.hssf.record.formula.FormulaParser");
junit.textui.TestRunner.run(TestFormulaParser.class); junit.textui.TestRunner.run(TestFormulaParser.class);