Skip to content

Commit

Permalink
Merge pull request #1464 from antony-liu/poi/bug-51519-and-45353
Browse files Browse the repository at this point in the history
Poi bug 51519 and 45353
  • Loading branch information
tonyqus authored Jan 15, 2025
2 parents 48dd6ca + b88b1e5 commit afa1a71
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
16 changes: 16 additions & 0 deletions testcases/main/HSSF/UserModel/TestBugs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3482,6 +3482,22 @@ public void Test53564()
}


[Test]
public void Test45353a()
{
IWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("named-cell-in-formula-test.xls");
wb.GetCreationHelper().CreateFormulaEvaluator().EvaluateAll();
wb.Close();
}

[Test]
public void Test45353b()
{
IWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("named-cell-test.xls");
wb.GetCreationHelper().CreateFormulaEvaluator().EvaluateAll();
wb.Close();
}

// follow https://svn.apache.org/viewvc?view=revision&revision=1896552 to write a unit test for this fix.
[Test]
public void Test52447()
Expand Down
23 changes: 20 additions & 3 deletions testcases/ooxml/XSSF/Extractor/TestXSSFExcelExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ public void TestEmptyCells()
}

/**
* Simple test for text box text
* @throws IOException
*/
* Simple test for text box text
* @throws IOException
*/
[Test]
public void TestTextBoxes()
{
Expand Down Expand Up @@ -294,6 +294,23 @@ public void Test67784Formulas()
extractor.Close();
}

[Test]
public void TestPhoneticRuns()
{
XSSFExcelExtractor extractor = GetExtractor("51519.xlsx");
try
{
String text = extractor.Text;
Assert.IsTrue(text.Contains("\u8C4A\u7530"));
//this shows up only as a phonetic run and should not appear
//in the extracted text
Assert.IsFalse(text.Contains("\u30CB\u30DB\u30F3"));
}
finally
{
extractor.Close();
}
}
}
}

Expand Down
Binary file added testcases/test-data/spreadsheet/51519.xlsx
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit afa1a71

Please sign in to comment.