]> source.dussan.org Git - poi.git/commitdiff
ensure xssfsheet getCellComments returns comments with client anchors set
authorPJ Fanning <fanningpj@apache.org>
Mon, 30 Jul 2018 02:08:37 +0000 (02:08 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 30 Jul 2018 02:08:37 +0000 (02:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837014 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java

index f6d00bac0052769ffe6b607d9986048dc9700ec5..68e3b29f40954d78343ea83e93aa00a8f2ca9024 100644 (file)
@@ -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<CellAddress, XSSFComment> map = new HashMap<>();
+        for(CellAddress address : sheetComments.getCellComments().keySet()) {
+            map.put(address, getCellComment(address));
+        }
+        return map;
     }
 
     /**