Browse Source

reduce use of comment iterator

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895209 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_5_2_0
PJ Fanning 2 years ago
parent
commit
18bb41fb27

+ 3
- 4
poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java View File

@@ -3051,10 +3051,9 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {

// also remove any comments associated with this row
if (sheetComments != null) {
Iterator<XSSFComment> commentIterator = sheetComments.commentIterator(this);
while (commentIterator.hasNext()) {
XSSFComment comment = commentIterator.next();
CellAddress ref = comment.getAddress();
Iterator<CellAddress> commentAddressIterator = sheetComments.getCellAddresses();
while (commentAddressIterator.hasNext()) {
CellAddress ref = commentAddressIterator.next();

// is this comment part of the current row?
if(rowsToRemoveSet.contains(ref.getRow())) {

Loading…
Cancel
Save