https://issues.apache.org/bugzilla/show_bug.cgi?id=56468

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31579|0                           |1
        is obsolete|                            |

--- Comment #6 from [email protected] ---
Created attachment 31581
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31581&action=edit
Patch for core.xml and app.xml

I think I have found two problem which caused the missing core.xml. in the
getPartsByRelationshipType(String) in OPCPackage.

The first problem is that the result of getPart(rel) in
getPartsByRelationshipType(String) is always added to the resulting ArrayList.
Even if getPart(rel) returns null.
So the size is never 0 if the relationshipType was added once, but the core is
still not on the part list and will not be written into the zip file a second
or third time. 

The second problem is that in the following if block in
saveImpl(zipOutputStream) in ZipPackage
if
(this.getPartsByRelationshipType(PackageRelationshipTypes.CORE_PROPERTIES).size()
== 0 && 
this.getPartsByRelationshipType(PackageRelationshipTypes.CORE_PROPERTIES_ECMA376).size()
== 0    ) {
...
}
the core is written to the zip output stream instead of added to the part list.

I have added a new diff.txt which includes the old one. Though I'm also new to
the code base I don't know if the patch causes other problems.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to