Bug 39800 - EscherOptRecord isn't serialising Properties Correctly
Summary: EscherOptRecord isn't serialising Properties Correctly
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HDF (show other bugs)
Version: 3.0-dev
Hardware: Other other
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-13 13:22 UTC by Nick Burch
Modified: 2006-06-13 10:01 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Burch 2006-06-13 13:22:16 UTC
I've discovered that the serialisation of properties from EscherOptRecord isn't
behaving on some EscherOptRecords in PowerPoint files.

The result is that they are serialised to a different (and I suspect incorrect)
set of bytes (compared to the bytes used to build the record).

I've added a (disabled) test to the end of TestEscherOptRecord which shows up
this bug - the serialised form will differ at byte 28.


(I'm going to have to leave a few HSLF tests disabled for now, as they're being
incorrectly tripped by byte-stream changes in EscherOptRecords)
Comment 1 Yegor Kozlov 2006-06-13 13:30:42 UTC
I also discovered this bug some time ago but put it aside for a while until my
hands are free. 

The problem is in org.apache.poi.ddf.EscherArrayProperty.

EscherArrayProperty.checkComplexData overrides the record data if the size of
the array is 0. 

Regards, Yegor
Comment 2 Nick Burch 2006-06-13 15:39:30 UTC
From some more debugging, it looks like my problem is an EscherArrayProperty,
but not an empty one. It's a problem in the simple part, more debugging is
required though.
Comment 3 Nick Burch 2006-06-13 17:01:11 UTC
Ah ha! After much poking with a debugger, I finally properly understand Glen's
cryptic comment in setArrayData

I've added a new flag, to record when the simple part's size doesn't include the
header length, so we can write it out the same.

I'm not sure if this'll help the zero size or not though, I'll have to find one
to be sure.