public XSSFComment createCellComment(ClientAnchor anchor) {
XSSFClientAnchor ca = (XSSFClientAnchor)anchor;
XSSFSheet sheet = (XSSFSheet)getParent();
//create comments and vmlDrawing parts if they don't exist
CommentsTable comments = sheet.getCommentsTable(true);
XSSFVMLDrawing vml = sheet.getVMLDrawing(true);
schemasMicrosoftComVml.CTShape vmlShape = vml.newCommentShape();
if(ca.isSet()){
String position =
ca.getCol1() + ", 0, " + ca.getRow1() + ", 0, " +
ca.getCol2() + ", 0, " + ca.getRow2() + ", 0";
vmlShape.getClientDataArray(0).setAnchorArray(0, position);
}
XSSFComment shape = new XSSFComment(comments, comments.newComment(), vmlShape);
shape.setColumn(ca.getCol1());
shape.setRow(ca.getRow1());
return shape;
}