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-Url: https://source.dussan.org/?a=commitdiff_plain;h=6e0a009b8f5ae00bf25654f22a26b5f4cc145a0b;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; } /**