Bug 53302 - [Patch] EscherAggregate does not handle Continue records
Summary: [Patch] EscherAggregate does not handle Continue records
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks: 53010
  Show dependency tree
 
Reported: 2012-05-27 20:48 UTC by Evgeniy Berlog
Modified: 2012-05-28 12:16 UTC (History)
0 users



Attachments
File from existing bugzilla bug to show current implementation defect (46.50 KB, application/vnd.ms-excel)
2012-05-27 20:48 UTC, Evgeniy Berlog
Details
Patch which fixes bug and addes unit tests (133.02 KB, patch)
2012-05-27 20:52 UTC, Evgeniy Berlog
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Evgeniy Berlog 2012-05-27 20:48:41 UTC
Created attachment 28839 [details]
File from existing bugzilla bug to show current implementation defect

When a worksheet contains drawing objects (shapes, pictures, etc.), the drawing parts in the BIFF format are stored together in a so called drawing aggregate. The object that handles this logic in HSSF is org.apache.poi.hssf.record.EscherAggregate. Current implementation assumes that a drawing aggregate consists of DrawingRecord, ObjRecord and TextObjectRecord objects. In reality, a drawing aggregate can include one or more Continue records at arbitrary positions. Current aggregation logic terminates at the first Continue record and, as result, the aggregated data is not complete. When parsing such incorrectly aggregated data into Escher tree, user can see warnings in stdout: "WARNING: N bytes remaining but no space left" and the parsed tree will not contain all shapes from the worksheet.  


..........
RowRecordsAggregate
DrawingRecord          <-- start of the drawing aggregate
ObjRecord
DrawingRecord
TextObjectRecord
DrawingRecord
ObjRecord
DrawingRecord
TextObjectRecord
DrawingRecord
ObjRecord
DrawingRecord
TextObjectRecord
DrawingRecord
ObjRecord
DrawingRecord
TextObjectRecord
ContinueRecord         <-- current implementation reads up to this point   
ObjRecord
ContinueRecord
TextObjectRecord       <-- end of the drawing aggregate
WindowTwoRecord
..........
Comment 1 Evgeniy Berlog 2012-05-27 20:52:43 UTC
Created attachment 28840 [details]
Patch which fixes bug and addes unit tests
Comment 2 Yegor Kozlov 2012-05-28 12:15:55 UTC
Applied in r1343218

Yegor