mirror of https://github.com/apache/poi.git
bug 60288: remove defensive copy for internal relationships. Patch from Tim Helmstedt. This closes #38.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765935 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
78ca6db13b
commit
8cdd805d9c
|
@ -1409,7 +1409,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||
*/
|
||||
@Override
|
||||
public boolean isRelationshipExists(PackageRelationship rel) {
|
||||
for (PackageRelationship r : this.getRelationships()) {
|
||||
for (PackageRelationship r : relationships) {
|
||||
if (r == rel) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -447,12 +447,9 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
|
|||
* @see org.apache.poi.openxml4j.opc.RelationshipSource#isRelationshipExists(org.apache.poi.openxml4j.opc.PackageRelationship)
|
||||
*/
|
||||
public boolean isRelationshipExists(PackageRelationship rel) {
|
||||
try {
|
||||
for (PackageRelationship r : this.getRelationships()) {
|
||||
if (r == rel)
|
||||
return true;
|
||||
}
|
||||
} catch (InvalidFormatException e){
|
||||
for (PackageRelationship r : _relationships) {
|
||||
if (r == rel)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue