Bug 60047 - XSSFDrawing.getShapes() changes Anchor type.
Summary: XSSFDrawing.getShapes() changes Anchor type.
Status: NEEDINFO
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.12-FINAL
Hardware: PC Linux
: P2 normal with 2 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-26 10:36 UTC by Dmitrii Rogozin
Modified: 2017-02-17 05:55 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitrii Rogozin 2016-08-26 10:36:13 UTC
XSSFDrawing.getShapes() changes Anchor type. 
The method calls getAnchorFromParent() method which suppose to return an anchor of the picture. Instead getAnchorFromParentcreates a new anchor
anchor = new XSSFClientAnchor(ct.getFrom(), ct.getTo()).

The anchor type is not set in XSSFClientAnchor constructor, that's why it is set to default (which is zero for int properties). 

As a result every time you call getShapes() method you set the anchorType of every picture/graph to 0 which is "move and size with Cells", so getAnchorType() will always return 0.
Comment 1 Javen O'Neal 2017-02-17 05:55:17 UTC
Would you be willing to write a unit test and patch for this? Seems like you're fairly familiar with the code.