From: PJ Fanning Date: Mon, 30 Jul 2018 02:08:37 +0000 (+0000) Subject: ensure xssfsheet getCellComments returns comments with client anchors set X-Git-Tag: REL_4_0_0_FINAL~58 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a3a452612532db7513c1c1343d8c8777f43229a1;p=poi.git ensure xssfsheet getCellComments returns comments with client anchors set git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837014 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index f6d00bac00..68e3b29f40 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -843,7 +843,12 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { if (sheetComments == null) { return Collections.emptyMap(); } - return sheetComments.getCellComments(); + // the cell comments in sheetComments.getCellComments() do not have the client anchors set + Map map = new HashMap<>(); + for(CellAddress address : sheetComments.getCellComments().keySet()) { + map.put(address, getCellComment(address)); + } + return map; } /**