mirror of https://github.com/apache/poi.git
bug 27852 - patch by Brice Copy
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353658 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
90b0251134
commit
51750acefd
|
@ -617,7 +617,7 @@ public class NameRecord extends Record {
|
|||
* @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;
|
||||
|
||||
|
@ -664,7 +664,7 @@ public class NameRecord extends Record {
|
|||
* @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 = "";
|
||||
|
||||
|
|
Binary file not shown.
|
@ -492,6 +492,22 @@ extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
/**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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue