}
}
-/*
- // シェイプ等のオブジェクトの削除・移動
- // xls形式
- if(sheet instanceof HSSFSheet) {
- try {
- HSSFClientAnchor anchor;
- HSSFPatriarch patriarch = ((HSSFSheet)sheet).getDrawingPatriarch();
- if(patriarch != null) {
- List<HSSFShape> shapes = patriarch.getChildren();
- if(shapes != null) {
- int r1, c1, r2, c2;
- for (int i = 0; i < shapes.size(); i++) {
- log.debug("shape class: {}", shapes.get(i).getClass().getName());
- // オブジェクトの位置情報取得
- anchor = (HSSFClientAnchor)shapes.get(i).getAnchor();
- if(anchor == null) continue;
- r1 = anchor.getRow1();
- c1 = anchor.getCol1();
- r2 = anchor.getRow2();
- c2 = anchor.getCol2();
- tmpRange = new CellRangeAddress(r1, r2, c1, c2);
-
- // 移動先範囲に含まれている、掛かっているなら移動
-
- // 移動元レンジに含まれている、掛かっているなら移動
- switch(CellRangeUtil.intersect(range, tmpRange)) {
- case CellRangeUtil.INSIDE:
- case CellRangeUtil.OVERLAP:
- anchor.setRow1(r1 + rowDistance);
- anchor.setRow2(r2 + rowDistance);
- anchor.setCol1(c1 + colDistance);
- anchor.setCol2(c2 + colDistance);
- log.debug("shape move from: [{}] to: [{}]", tmpRange.formatAsString(), (new CellRangeAddress(anchor.getRow1(), anchor.getRow2(), anchor.getCol1(), anchor.getCol2())).formatAsString());
- }
- }
- }
- }
- }
- catch(Exception e) {
- log.error("shape move error: {}", e.getMessage(), e);
- }
- }
-*/
// シェイプ等のオブジェクトの削除・移動 Excel2007以降 ooxml形式のみ対応
if(sheet instanceof XSSFSheet) {
XSSFSheet xSheet = (XSSFSheet) sheet;