]> source.dussan.org Git - poi.git/commitdiff
bug 35084, reported by Stefano Rocca. fixed in Sheet.java
authorAvik Sengupta <avik@apache.org>
Tue, 31 May 2005 19:10:47 +0000 (19:10 +0000)
committerAvik Sengupta <avik@apache.org>
Tue, 31 May 2005 19:10:47 +0000 (19:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353705 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/model/FormulaParser.java
src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java

index 2141b53ed086616e33c68b28bc3a4b6282251965..229aff2c890f1dd9b479edda41ffa2f686ab6986 100644 (file)
@@ -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=='_';
     }
     
     
index 1e69ce0ed36f244896d151c458adaba215ecfeee..812a42d71cf33f217585baa7ae94919c706946c3 100644 (file)
@@ -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");