diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-11-19 18:01:34 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-11-19 18:01:34 +0000 |
commit | 72dbcf4702a865fa8d8bd166130c77f94148c762 (patch) | |
tree | dffc352ee6fc5b1b99edc29c1dcef87e1f101ec2 /poi-ooxml | |
parent | b4f36926dc1d91374dbdc01e8f897f821e38eb86 (diff) | |
download | poi-72dbcf4702a865fa8d8bd166130c77f94148c762.tar.gz poi-72dbcf4702a865fa8d8bd166130c77f94148c762.zip |
try to make CommentsTable more extensible
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895180 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/model/Comments.java | 4 | ||||
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/model/CommentsTable.java | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/Comments.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/Comments.java index 0223f60926..494fa98a9e 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/Comments.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/Comments.java @@ -16,8 +16,8 @@ ==================================================================== */ 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; @@ -84,7 +84,7 @@ public interface Comments { * @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 diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CommentsTable.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CommentsTable.java index 9b3a2f888b..816533e907 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CommentsTable.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CommentsTable.java @@ -27,6 +27,7 @@ import java.util.Map; 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; @@ -256,10 +257,10 @@ public class CommentsTable extends POIXMLDocumentPart implements Comments { * @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 |