mirror of https://github.com/apache/poi.git
bug 59279: add Comment.equals and hashCode methods
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1748814 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
aa4f9a4e00
commit
3984215fbd
|
@ -320,4 +320,18 @@ public class HSSFComment extends HSSFTextbox implements Comment {
|
||||||
setPropertyValue(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, false, false, property.getPropertyValue() & GROUP_SHAPE_NOT_HIDDEN_MASK));
|
setPropertyValue(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, false, false, property.getPropertyValue() & GROUP_SHAPE_NOT_HIDDEN_MASK));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (!(obj instanceof HSSFComment)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
HSSFComment other = (HSSFComment) obj;
|
||||||
|
return getNoteRecord().equals(other.getNoteRecord());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ((getRow()*17) + getColumn())*31;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,4 +239,19 @@ public class XSSFComment implements Comment {
|
||||||
protected CTShape getCTShape(){
|
protected CTShape getCTShape(){
|
||||||
return _vmlShape;
|
return _vmlShape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (!(obj instanceof XSSFComment)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
XSSFComment other = (XSSFComment) obj;
|
||||||
|
return ((getCTComment() == other.getCTComment()) &&
|
||||||
|
(getCTShape() == other.getCTShape()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return ((getRow()*17) + getColumn())*31;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue