Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- java.util.List<CTTwoCellAnchor> drawingAnchors = ((XSSFDrawing)sheet.getDrawingPatriarch()).getCTDrawing().getTwoCellAnchorList();
- for (CTTwoCellAnchor drawingAnchor : drawingAnchors) {
- int fromRow = drawingAnchor.getFrom().getRow();
- int toRow = drawingAnchor.getTo().getRow();
- if (fromRow >= startRow) {
- drawingAnchor.getFrom().setRow(fromRow + n);
- drawingAnchor.getTo().setRow(toRow + n);
- }
- }
- XSSFDrawing drawing = sheet.createDrawingPatriarch();
- for (XSSFShape shape : drawing.getShapes()) {
- if (shape instanceof XSSFPicture){
- XSSFClientAnchor anchor = ((XSSFPicture)shape).getClientAnchor();
- anchor.setRow1(anchor.getRow1() +n); // n can be negative to move up
- anchor.setRow2(anchor.getRow2() +n);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement