https://issues.apache.org/bugzilla/show_bug.cgi?id=40008--- Comment #5 from Josh Micich <
josh@...> 2009-11-04 19:00:24 UTC ---
From the documentation, Ptg 0x1A seems to be only used until BIFF4, where it
was known as "tSheet". It seems most likely that the original source of this
error was a problem elsewhere in the Ptg deserialization logic that caused an
mis-aligned read.
I made sure that no example files on hand disagree with this conclusion. The
code you mentioned (which apparent handles Ptg 0x1A) has been removed in svn
r832975 (it was originally added in svn r615859 as part of the fix for bug
42618).
Note - problems like this are harder to reproduce after svn r709235. In that
change, formulas no longer get eagerly converted to Ptg arrays. Now this only
happens when the calling Cell.getCellFormula() and during formula evaluation.
So if the original problem were still present, it may not surface until you
access the formula in the offending cell. For enhanced testing, the following
modification can be made to Formula.java (forcing every formula to be
deserialized to Ptg arrays):
--- src/java/org/apache/poi/ss/formula/Formula.java (revision 832596)
+++ src/java/org/apache/poi/ss/formula/Formula.java (working copy)
@@ -77,7 +77,9 @@
public static Formula read(int encodedTokenLen, LittleEndianInput in,
int totalEncodedLen) {
byte[] byteEncoding = new byte[totalEncodedLen];
in.readFully(byteEncoding);
- return new Formula(byteEncoding, encodedTokenLen);
+ Formula result = new Formula(byteEncoding, encodedTokenLen);
+ result.getTokens();
+ return result;
}
I ran all the junits with this additional change in place, to make sure that
Ptg 0x1a is not referenced in any existing sample file. (Incidentally there
still seems to be examples of Ptg 0x00)
--
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:
dev-unsubscribe@...
For additional commands, e-mail:
dev-help@...