bug 59443: exit early on setAddress if address is the same
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1742881 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
191726ee7b
commit
730641576a
@ -145,10 +145,9 @@ public class CellAddress implements Comparable<CellAddress> {
|
||||
return false;
|
||||
}
|
||||
|
||||
CellAddress cr = (CellAddress) o;
|
||||
return _row == cr._row
|
||||
&& _col == cr._col
|
||||
;
|
||||
CellAddress other = (CellAddress) o;
|
||||
return _row == other._row &&
|
||||
_col == other._col;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -143,6 +143,10 @@ public class XSSFComment implements Comment {
|
||||
@Override
|
||||
public void setAddress(CellAddress address) {
|
||||
CellAddress oldRef = new CellAddress(_comment.getRef());
|
||||
if (address.equals(oldRef)) {
|
||||
// nothing to do
|
||||
return;
|
||||
}
|
||||
|
||||
_comment.setRef(address.formatAsString());
|
||||
_comments.referenceUpdated(oldRef, _comment);
|
||||
@ -162,6 +166,8 @@ public class XSSFComment implements Comment {
|
||||
/**
|
||||
* Set the column of the cell that contains the comment
|
||||
*
|
||||
* If changing both row and column, use {@link #setAddress}.
|
||||
*
|
||||
* @param col the 0-based column of the cell that contains the comment
|
||||
*/
|
||||
@Override
|
||||
@ -172,6 +178,8 @@ public class XSSFComment implements Comment {
|
||||
/**
|
||||
* Set the row of the cell that contains the comment
|
||||
*
|
||||
* If changing both row and column, use {@link #setAddress}.
|
||||
*
|
||||
* @param row the 0-based row of the cell that contains the comment
|
||||
*/
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user