Author: fanningpj
Date: Sun Dec 10 13:30:59 2023
New Revision: 1914511

URL: http://svn.apache.org/viewvc?rev=1914511&view=rev
Log:
[bug-68305] add test

Modified:
    
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java

Modified: 
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java?rev=1914511&r1=1914510&r2=1914511&view=diff
==============================================================================
--- 
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
 (original)
+++ 
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
 Sun Dec 10 13:30:59 2023
@@ -114,6 +114,21 @@ public final class TestXSSFFormulaEvalua
         }
     }
 
+    @Test
+    void testEvaluateFormulaWithSheetRefEscapedApostrophe() throws IOException 
{
+        // https://bz.apache.org/bugzilla/show_bug.cgi?id=68305
+        try (XSSFWorkbook wb = new XSSFWorkbook()) {
+            XSSFSheet sheet1 = wb.createSheet("Sheet1");
+            XSSFSheet sheet2 = wb.createSheet("(2) 4-Tension Bolt MC's");
+            sheet2.createRow(0).createCell(0).setCellValue(1.0);
+            XSSFCell xssfCell = sheet1.createRow(0).createCell(0);
+            xssfCell.setCellFormula("'(2) 4-Tension Bolt MC''s'!A1");
+            XSSFFormulaEvaluator xssfFormulaEvaluator = new 
XSSFFormulaEvaluator(wb);
+            xssfFormulaEvaluator.evaluateInCell(xssfCell);
+            assertEquals(1.0, xssfCell.getNumericCellValue());
+        }
+    }
+
     /**
      * Related to bugs #56737 and #56752 - XSSF workbooks which have
      *  formulas that refer to cells and named ranges in multiple other



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org
For additional commands, e-mail: commits-h...@poi.apache.org

Reply via email to