==================================================================== */
package org.apache.poi.xssf.model;
+import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.util.CellAddress;
-import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
import org.apache.poi.xssf.usermodel.XSSFComment;
import org.apache.poi.xssf.usermodel.XSSFSheet;
* @return new XSSFComment
* @since POI 5.2.0
*/
- XSSFComment createNewComment(XSSFSheet sheet, XSSFClientAnchor clientAnchor);
+ XSSFComment createNewComment(XSSFSheet sheet, ClientAnchor clientAnchor);
/**
* Called after the reference is updated, so that
import org.apache.poi.ooxml.POIXMLDocumentPart;
import org.apache.poi.openxml4j.opc.PackagePart;
+import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.util.CellAddress;
import org.apache.poi.util.Internal;
import org.apache.poi.util.Removal;
* @since POI 5.2.0
*/
@Override
- public XSSFComment createNewComment(XSSFSheet sheet, XSSFClientAnchor clientAnchor) {
+ public XSSFComment createNewComment(XSSFSheet sheet, ClientAnchor clientAnchor) {
XSSFVMLDrawing vml = sheet.getVMLDrawing(true);
com.microsoft.schemas.vml.CTShape vmlShape = vml.newCommentShape();
- if (clientAnchor.isSet()) {
+ if (clientAnchor instanceof XSSFClientAnchor && ((XSSFClientAnchor)clientAnchor).isSet()) {
// convert offsets from emus to pixels since we get a
// DrawingML-anchor
// but create a VML Drawing