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

Yegor Kozlov <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Yegor Kozlov <[email protected]> 2011-06-01 12:11:37 UTC ---
Applied in r1130120.

This is a really good change. I didn't research hadling of pictures in XSSF and
XSLF, but suspect that they should use the same logic as XWPFDocument and reuse
image parts. If so, we should consider moving this logic to POIXMLDocument. 

> While changing POIXMLDocumentPart, the relation-handling was reworked. Instead
> of keeping a simple list of all related parts, a Map was used, which uses the
> relation-ID as key and the target part as value. This eases the handling of 
> all
> parts, but required some changes to the API (changes to XSSFDrawing have been
> applied). Additionally, the original list was kept in order to represent the
> relation-sequence, as these appear in the _rels XML document and several
> Unit-tests rely on this sequence. 

I changed this part a little bit. There is no need to have both a Map and a
List to maintain the collection of POIXMLDocumentParts. I turned relations into
a ordered map :
    private Map<String,POIXMLDocumentPart> relations = new
LinkedHashMap<String,POIXMLDocumentPart>(); 

The relationsOrder list is not needed and I removed it. 

> I do not recommend to rely on it, as a
> relation is defined by id, type and target only, whereas the position in the
> according _rels is not part of the information a PackageRelationship is 
> defined
> of, in terms of the OPC.
> 

We should not rely on the order of relations when constructing OPC packages,
but we *should* preserve the order of relations when reading / saving a a
package. This is why we need to store document parts in a ordered collection.

P.S.  please use a standard archive tool (.zip or .gz) instead of 7z.

Regards,
Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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