poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54916] [PATCH] POI does not always read all the slides in pptx files
Date Sat, 08 Feb 2014 21:51:37 GMT

--- Comment #4 from Andreas Beeker <andreas.beeker@gmx.de> ---
Created attachment 31296
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31296&action=edit
delegate-example to handle parent relations

In the attached example I'd like to demonstrate what I want to change in those
many subclasses of POIXMLDocumentPart.

The main problem (as stated in the bug thread) is, that the current
implementation doesn't track the (incoming or parent) package relations right,
i.e. a referenced child has only one package relation, which is definitely not
true for shared objects like slide masters/layouts.

The straightforward implementation would be, to deprecate
POIXMLDocumentPart.getPackageRelationship() and introduce a
POIXMLDocumentPart.getPackageRelationship(POIXMLDocumentPart parent) method
instead, but as the code is already out in the wild, this is probably not the
way to go.

So instead I'd like to introduce a delegate mechanism. When the objects are
linked together in POIXMLDocumentPart.read() this would take to care to create
the necessary delegates.

The delegate itself is a simple inner class extending the outer class so
instance-of checks stay valid and the delegate can be used the same way the
original class was.

Instead of duplicating all method calls in the inner class and maybe forgetting
to insert a call when a new method is introduced, I thought it's better to
handle it via the following method prefix ...

public sometype methodname(args ...) {
   if (isDelegate()) {
      return getThis().methodname(args ...);
   // and now the normal method content

So what do you think about this?
(... or maybe I missed a point of how these ooxml classes work ...)

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

To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message