Right. I guess that must have been it. Premature optimization! ;-) On 12.07.2011 12:10:59 mehdi houshmand wrote: > Hi Jeremias, > > Yes, I agree, I wasn't trying to make a point, or even contest the > commit. You said in the commit message that you weren't sure why you > did that originally, I just wanted to illustrate why. Both ways make > sense. > > Mehdi > > On 12 July 2011 10:40, Jeremias Maerki <[email protected]> wrote: > > Hi Mehdi > > > > Sure, but imagine someone cuts an AFP appart at some page group boundary > > to make smaller print streams. The second part might not contain the IMM > > instruction and might therefore end up printed wrong. The splitter would > > have to have the intelligence to scan the whole AFP and insert new IMMs > > during the split. I think it's safer this way. > > > > On 12.07.2011 11:12:27 mehdi houshmand wrote: > >> Hi Jeremias, > >> > >> Just to satiate your curiousity, in the modca spec, page 96, it says > >> "A medium map remains in effect until another medium map is selected > >> or the end of the document is reached.", which means the previous > >> implementation, storing the lastMediumMap, would be perfectly valid. > >> > >> Mehdi > >> > >> On 8 July 2011 16:00, <[email protected]> wrote: > >> > Author: jeremias > >> > Date: Fri Jul 8 15:00:47 2011 > >> > New Revision: 1144351 > >> > > >> > URL: http://svn.apache.org/viewvc?rev=1144351&view=rev > >> > Log: > >> > Removed the lastMediumMap variable and the check to omit the IMM if it > >> > doesn't change. I wonder why I came up with that. This can lead, among > >> > other things, to problems when an AFP file is split. > >> > > >> > Modified: > >> > > >> > xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java > >> > > >> > Modified: > >> > xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java > >> > URL: > >> > http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java?rev=1144351&r1=1144350&r2=1144351&view=diff > >> > ============================================================================== > >> > --- > >> > xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java > >> > (original) > >> > +++ > >> > xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java > >> > Fri Jul 8 15:00:47 2011 > >> > @@ -83,9 +83,6 @@ public class AFPDocumentHandler extends > >> > private Map<String, PageSegmentDescriptor> pageSegmentMap > >> > = new java.util.HashMap<String, PageSegmentDescriptor>(); > >> > > >> > - /** Medium Map referenced on previous page **/ > >> > - private String lastMediumMap; > >> > - > >> > private static enum Location { > >> > ELSEWHERE, IN_DOCUMENT_HEADER, FOLLOWING_PAGE_SEQUENCE, > >> > IN_PAGE_HEADER > >> > } > >> > @@ -379,9 +376,8 @@ public class AFPDocumentHandler extends > >> > } > >> > AFPInvokeMediumMap imm = (AFPInvokeMediumMap)extension; > >> > String mediumMap = imm.getName(); > >> > - if (mediumMap != null && !mediumMap.equals(lastMediumMap)) { > >> > + if (mediumMap != null) { > >> > dataStream.createInvokeMediumMap(mediumMap); > >> > - lastMediumMap = mediumMap; > >> > } > >> > } else if (extension instanceof AFPIncludeFormMap) { > >> > AFPIncludeFormMap formMap = (AFPIncludeFormMap)extension; > >> > > >> > > >> > > >> > --------------------------------------------------------------------- > >> > To unsubscribe, e-mail: [email protected] > >> > For additional commands, e-mail: [email protected] > >> > > >> > > > > > > > > > > > Jeremias Maerki > > > >
Jeremias Maerki
