Summary: | HSSFSimpleShape can not draw line properly. | ||
---|---|---|---|
Product: | POI | Reporter: | namsu <ta-seok> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WONTFIX | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP |
Description
namsu
2008-06-29 23:47:54 UTC
I did some analysis: it seems Excel and OpenOffice use a flag "FLIPVERT" and reverse vertical coordinates for the second drawing, so a workaround currently is to use the following: HSSFClientAnchor a1 = new HSSFClientAnchor(); a1.setAnchor( (short)2, 2, 512, 0, (short) 2, 2, 1024, 100); HSSFSimpleShape shape1 = patriarch.createSimpleShape(a1); shape1.setFlipVertical(true); shape1.setShapeType(HSSFSimpleShape.OBJECT_TYPE_LINE); we probably need to search the spec if this behavior is described, when the record is serialized, the data ends up in two separate sub-records of the EscherContainerRecord: Child 0: org.apache.poi.ddf.EscherSpRecord: RecordId: 0xF00A Version: 0x0002 ShapeType: 0x0014 ShapeId: 1025 Flags: FLIPVERT|HAVEANCHOR|HASSHAPETYPE (0x00000A80) ... Child 2: org.apache.poi.ddf.EscherClientAnchorRecord: RecordId: 0xF010 Version: 0x0000 Instance: 0x0000 Flag: 0 Col1: 2 DX1: 512 Row1: 2 DY1: 0 Col2: 2 DX2: 1024 Row2: 2 DY2: 100 Extra Data: No Data I looked at the spec, there is no mention of this behavior and I don't see an easy way of handling this inside POI with correct backwards compatibility. Therefore I have updated javadoc via r1621586 to mention that some flipping might be necessary. So overall this Bug is WONTFIX as we don't fix it in POI as the behavior is caused by Excel itself in an undocumented way. |