Bug 60047

Summary: XSSFDrawing.getShapes() changes Anchor type.
Product: POI Reporter: Dmitrii Rogozin <dmitrii>
Component: XSSFAssignee: POI Developers List <dev>
Status: NEEDINFO ---    
Severity: normal    
Priority: P2    
Version: 3.12-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

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.