https://issues.apache.org/bugzilla/show_bug.cgi?id=44921
Josh Micich <[EMAIL PROTECTED]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #5 from Josh Micich <[EMAIL PROTECTED]> 2008-05-02 15:35:54 PST ---
Fix applied in svn r652934
The fix involves allowing all relative ref Ptgs (RefN*.java and AreaN*.java) to
be written out (/serialized).
This bug was probably not visible before, because conditional formats and data
validation are recent additions to POI. These use relative-reference Ptgs
(similar to those of shared formulas). In earlier versions of POI a strategy
was adopted to convert these Ptgs to absolute references (I assume) to make the
formula evaluation stuff easier. Hence relative reference Ptgs were never
expected to be serialized. For the new conditional format and data validation
stuff, the conversion does not take place (and probably shouldn't) so that's
why the error occurred.
Seems like Andy hit a very similar problem before (see svn r513604). I can't
find a bugzilla record though.
There are significant problems with how relative references are handled by POI
(see bug 44636). This bug was also fixed with a small change, but a more
correct solution will probably involve skipping the shared formula conversion
stuff.
For interest, here are the two stack trace fragments showing how the
conditional format and data validation stuff is relevant to this bug:
RefNVPtg.writeBytes(byte[], int) line: 51
Ptg.serializePtgStack(Stack, byte[], int) line: 394
CFRuleRecord.serialize(int, byte[]) line: 567
CFRecordsAggregate.serialize(int, byte[]) line: 168
Sheet.serialize(int, byte[]) line: 830
RefNVPtg.writeBytes(byte[], int) line: 51
DVRecord.serialize(int, byte[]) line: 462
Sheet.serialize(int, byte[]) line: 830
BTW - when supplying sample code, please try to use plain java (1.4 or 1.5).
Also try to cut out as much unneeded stuff as possible. This bug can actually
be re-produced with the following code:
HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream("ex44921-21902.xls"));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
original.write(baos);
--
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]