我正在尝试将 CellComment 复制到新单元格(使用 Apache POI)。我知道我必须创建新评论(而不是将旧评论设置到新单元格中),但我似乎无法找出如何复制 Anchor。
private void createComment(Cell aNewCell, Comment theOldComment) {
CreationHelper createHelper = aNewCell.getSheet().getWorkbook().getCreationHelper();
ClientAnchor anchor = createHelper.createClientAnchor();
// How to get the old CellComment anchor for x1, c2, y1, y2???
Drawing drawing = aNewCell.getSheet().createDrawingPatriarch();
Comment aNewComment = drawing.createCellComment(anchor);
aNewComment.setString(theOldComment.getString());
aNewCell.setCellComment(aNewComment);
}