https://issues.apache.org/bugzilla/show_bug.cgi?id=50718
Summary: New CellReference created from missing Name throws
"Mismatched quotes" Runtime Ex
Product: POI
Version: 3.7
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: POI Overall
AssignedTo: [email protected]
ReportedBy: [email protected]
Creating a CellReference from a Name's "refers to formula" when that named
range has been half deleted throws a misleading exception:
"java.lang.RuntimeException: Mismatched quotes: ('MySheetName'!#REF!)"
If a Name has been half deleted (e.g. one row out of the two the Name refers to
is deleted) then the method Name.getRefersToFormula() will return something
like:
'MySheetName'!#REF!
When creating a CellReference from this string the
org.apache.poi.ss.util.CellReference.parseSheetName(CellReference.java:376)
method will fail as it does not expect the string to contain two "!"
characters.
The CellReference is created as follows:
AreaReference aref = new AreaReference(namedRange.getRefersToFormula());
The exception is misleading as the real error is that the "refers to formula"
(the "reference" param in the parseSheetName() method) is really invalid. Both
quotes are present thus the error "Mismatched quotes" is not correct.
The relevant stack trace is:
java.lang.RuntimeException: Mismatched quotes: ('MySheetTitle'!#REF!)
at
org.apache.poi.ss.util.CellReference.parseSheetName(CellReference.java:376)
at
org.apache.poi.ss.util.CellReference.separateRefParts(CellReference.java:340)
at org.apache.poi.ss.util.CellReference.<init>(CellReference.java:88)
at org.apache.poi.ss.util.AreaReference.<init>(AreaReference.java:55)
at org.apache.poi.hssf.util.AreaReference.<init>(AreaReference.java:28)
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]