diff options
author | Dominik Stadler <centic@apache.org> | 2015-07-24 11:58:01 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2015-07-24 11:58:01 +0000 |
commit | b5fcac48e1606a9d3893cbd31adcf94459192c31 (patch) | |
tree | e4bc7b75756d5cc18e0dbe53b7de0c884baae8a7 /src/ooxml/java/org/apache/poi/xssf/usermodel | |
parent | c5156fd83beeabcaca8dcc4c4bb0999357ecf91f (diff) | |
download | poi-b5fcac48e1606a9d3893cbd31adcf94459192c31.tar.gz poi-b5fcac48e1606a9d3893cbd31adcf94459192c31.zip |
Bug 57571, Bug 58175: Fix creating comments for XSSF/SXSSF, regression was introduced via bug 54920
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1692483 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xssf/usermodel')
-rw-r--r-- | src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java index 51ef179e66..65eefec559 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java @@ -49,6 +49,22 @@ public class XSSFComment implements Comment { _comment = comment; _comments = comments; _vmlShape = vmlShape; + + // we potentially need to adjust the column/row information in the shape + // the same way as we do in setRow()/setColumn() + if(vmlShape != null && vmlShape.sizeOfClientDataArray() > 0) { + CellReference ref = new CellReference(comment.getRef()); + vmlShape.getClientDataArray(0).setRowArray(0, + new BigInteger(String.valueOf(ref.getRow()))); + + vmlShape.getClientDataArray(0).setColumnArray(0, + new BigInteger(String.valueOf(ref.getCol()))); + + // There is a very odd xmlbeans bug when changing the row + // arrays which can lead to corrupt pointer + // This call seems to fix them again... See bug #50795 + vmlShape.getClientDataList().toString(); + } } /** |