git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895176 13f79535-47bb-0310-9956-ffa450edef68tags/REL_5_2_0
@@ -91,7 +91,17 @@ public interface Comments { | |||
* we can reflect that in our cache | |||
* @param oldReference the comment to remove from the commentRefs map | |||
* @param comment the comment to replace in the commentRefs map | |||
* @see #commentUpdated(XSSFComment) | |||
* @since POI 5.2.0 | |||
*/ | |||
void referenceUpdated(CellAddress oldReference, XSSFComment comment); | |||
/** | |||
* Called after the comment is updated, so that | |||
* we can reflect that in our cache | |||
* @param comment the comment to replace in the commentRefs map | |||
* @since POI 5.2.0 | |||
* @see #referenceUpdated(CellAddress, XSSFComment) | |||
*/ | |||
void commentUpdated(XSSFComment comment); | |||
} |
@@ -141,6 +141,7 @@ public class CommentsTable extends POIXMLDocumentPart implements Comments { | |||
* we can reflect that in our cache | |||
* @param oldReference the comment to remove from the commentRefs map | |||
* @param comment the comment to replace in the commentRefs map | |||
* @see #commentUpdated(XSSFComment) | |||
* @since POI 5.2.0 | |||
*/ | |||
@Override | |||
@@ -151,6 +152,18 @@ public class CommentsTable extends POIXMLDocumentPart implements Comments { | |||
} | |||
} | |||
/** | |||
* Called after the comment is updated, so that | |||
* we can reflect that in our cache | |||
* @param comment the comment to replace in the commentRefs map | |||
* @since POI 5.2.0 | |||
* @see #referenceUpdated(CellAddress, XSSFComment) | |||
*/ | |||
@Override | |||
public void commentUpdated(XSSFComment comment) { | |||
//no-op in this implementation | |||
} | |||
@Override | |||
public int getNumberOfComments() { | |||
return comments.getCommentList().sizeOfCommentArray(); |
@@ -92,6 +92,7 @@ public class XSSFComment implements Comment { | |||
@Override | |||
public void setAuthor(String author) { | |||
_comment.setAuthorId(_comments.findAuthor(author)); | |||
_comments.commentUpdated(this); | |||
} | |||
/** | |||
@@ -152,6 +153,7 @@ public class XSSFComment implements Comment { | |||
} | |||
} | |||
} | |||
_comments.commentUpdated(this); | |||
} | |||
@Override | |||
@@ -182,6 +184,7 @@ public class XSSFComment implements Comment { | |||
avoidXmlbeansCorruptPointer(_vmlShape); | |||
} | |||
_comments.commentUpdated(this); | |||
} | |||
/** | |||
@@ -232,6 +235,7 @@ public class XSSFComment implements Comment { | |||
} | |||
_str = (XSSFRichTextString)string; | |||
_comment.setText(_str.getCTRst()); | |||
_comments.commentUpdated(this); | |||
} | |||
public void setString(String string) { |