mirror of https://github.com/apache/poi.git
fix broken test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895211 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3d44f76500
commit
537ddf53b9
|
@ -3051,19 +3051,21 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
|
||||||
|
|
||||||
// also remove any comments associated with this row
|
// also remove any comments associated with this row
|
||||||
if (sheetComments != null) {
|
if (sheetComments != null) {
|
||||||
|
ArrayList<CellAddress> refsToRemove = new ArrayList<>();
|
||||||
Iterator<CellAddress> commentAddressIterator = sheetComments.getCellAddresses();
|
Iterator<CellAddress> commentAddressIterator = sheetComments.getCellAddresses();
|
||||||
while (commentAddressIterator.hasNext()) {
|
while (commentAddressIterator.hasNext()) {
|
||||||
CellAddress ref = commentAddressIterator.next();
|
CellAddress ref = commentAddressIterator.next();
|
||||||
|
|
||||||
// is this comment part of the current row?
|
// is this comment part of the current row?
|
||||||
if(rowsToRemoveSet.contains(ref.getRow())) {
|
if(rowsToRemoveSet.contains(ref.getRow())) {
|
||||||
|
refsToRemove.add(ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (CellAddress ref : refsToRemove) {
|
||||||
sheetComments.removeComment(ref);
|
sheetComments.removeComment(ref);
|
||||||
if (vml != null) {
|
if (vml != null) {
|
||||||
vml.removeCommentShape(ref.getRow(), ref.getColumn());
|
vml.removeCommentShape(ref.getRow(), ref.getColumn());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// also remove any hyperlinks associated with this row
|
// also remove any hyperlinks associated with this row
|
||||||
|
@ -3106,7 +3108,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
|
||||||
XSSFRow row = (XSSFRow)it.next();
|
XSSFRow row = (XSSFRow)it.next();
|
||||||
int rownum = row.getRowNum();
|
int rownum = row.getRowNum();
|
||||||
|
|
||||||
if(sheetComments != null){
|
if(sheetComments != null) {
|
||||||
// calculate the new rownum
|
// calculate the new rownum
|
||||||
int newrownum = shiftedRowNum(startRow, endRow, n, rownum);
|
int newrownum = shiftedRowNum(startRow, endRow, n, rownum);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue