Skip to content

Commit

Permalink
bug 27852 - patch by Brice Copy
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353658 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Avik Sengupta committed Apr 28, 2005
1 parent 8b20b4a commit 8b1e706
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/java/org/apache/poi/hssf/record/NameRecord.java
Expand Up @@ -617,7 +617,7 @@ public int getRecordSize(){
* @return extern sheet index
*/
public short getExternSheetNumber(){
if (field_13_name_definition == null) return 0;
if (field_13_name_definition == null || field_13_name_definition.isEmpty()) return 0;
Ptg ptg = (Ptg) field_13_name_definition.peek();
short result = 0;

Expand Down Expand Up @@ -664,7 +664,7 @@ private Ptg createNewPtg(){
* @return area reference
*/
public String getAreaReference(Workbook book){
if (field_13_name_definition == null) return "#REF!";
if (field_13_name_definition == null || field_13_name_definition.isEmpty()) return "#REF!";
Ptg ptg = (Ptg) field_13_name_definition.peek();
String result = "";

Expand Down
Binary file added src/testcases/org/apache/poi/hssf/data/27852.xls
Binary file not shown.
16 changes: 16 additions & 0 deletions src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
Expand Up @@ -491,6 +491,22 @@ public void test15573() throws java.io.IOException {
assertTrue("No Exceptions while reading file", true);

}

/**names and macros */
public void test27852() throws java.io.IOException {
String filename = System.getProperty("HSSF.testdata.path");
filename=filename+"/27852.xls";
FileInputStream in = new FileInputStream(filename);
HSSFWorkbook wb = new HSSFWorkbook(in);
assertTrue("No Exceptions while reading file", true);
for(int i = 0 ; i < wb.getNumberOfNames() ; i++)
{
HSSFName name = wb.getNameAt(i);
name.getNameName();
name.getReference();
}
assertTrue("No Exceptions till here!", true);
}

}

Expand Down

0 comments on commit 8b1e706

Please sign in to comment.