xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vhenneb...@apache.org
Subject svn commit: r768321 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca: AbstractPageObject.java AbstractResourceGroupContainer.java PageGroup.java
Date Fri, 24 Apr 2009 14:39:32 GMT
Author: vhennebert
Date: Fri Apr 24 14:39:32 2009
New Revision: 768321

URL: http://svn.apache.org/viewvc?rev=768321&view=rev
Log:
In the AFP stream, put the TLE fields associated to a page sequence before the Page elements
instead of after

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageGroup.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java?rev=768321&r1=768320&r2=768321&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java Fri Apr
24 14:39:32 2009
@@ -212,6 +212,17 @@
     }
 
     /**
+     * Returns the list of {@link TagLogicalElement}s.
+     * @return the TLEs
+     */
+    protected List getTagLogicalElements() {
+        if (tagLogicalElements == null) {
+            this.tagLogicalElements = new java.util.ArrayList/*<TagLogicalElement>*/();
+        }
+        return this.tagLogicalElements;
+    }
+
+    /**
      * Creates a TagLogicalElement on the page.
      *
      * @param name
@@ -223,10 +234,8 @@
      */
     public void createTagLogicalElement(String name, String value, int tleID) {
         TagLogicalElement tle = new TagLogicalElement(name, value, tleID);
-        if (tagLogicalElements == null) {
-            tagLogicalElements = new java.util.ArrayList/*<TagLogicalElement>*/();
-        }
-        tagLogicalElements.add(tle);
+        List list = getTagLogicalElements();
+        list.add(tle);
     }
 
     /**

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java?rev=768321&r1=768320&r2=768321&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java
Fri Apr 24 14:39:32 2009
@@ -141,12 +141,25 @@
 
     /** {@inheritDoc} */
     protected void writeObjects(Collection/*<AbstractAFPObject>*/ objects, OutputStream
os)
-    throws IOException {
+            throws IOException {
+        writeObjects(objects, os, false);
+    }
+
+    /**
+     * Writes a collection of {@link AbstractAFPObject}s to the AFP Datastream.
+     *
+     * @param objects a list of AFPObjects
+     * @param os The stream to write to
+     * @param forceWrite true if writing should happen in any case
+     * @throws java.io.IOException an I/O exception of some sort has occurred.
+     */
+    protected void writeObjects(Collection/*<AbstractAFPObject>*/ objects, OutputStream
os,
+            boolean forceWrite) throws IOException {
         if (objects != null && objects.size() > 0) {
             Iterator it = objects.iterator();
             while (it.hasNext()) {
                 AbstractAFPObject ao = (AbstractAFPObject)it.next();
-                if (canWrite(ao)) {
+                if (forceWrite || canWrite(ao)) {
                     ao.writeToStream(os);
                     it.remove();
                 } else {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageGroup.java?rev=768321&r1=768320&r2=768321&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageGroup.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageGroup.java Fri Apr 24 14:39:32
2009
@@ -21,7 +21,6 @@
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.List;
 
 import org.apache.fop.afp.Factory;
 
@@ -36,9 +35,6 @@
  */
 public class PageGroup extends AbstractResourceEnvironmentGroupContainer {
 
-    /** The tag logical elements contained within this group */
-    private List tagLogicalElements = null;
-
     /**
      * Sequence number for TLE's.
      */
@@ -56,13 +52,6 @@
         this.tleSequence = tleSequence;
     }
 
-    private List getTagLogicalElements() {
-        if (tagLogicalElements == null) {
-            this.tagLogicalElements = new java.util.ArrayList();
-        }
-        return this.tagLogicalElements;
-    }
-
     /**
      * Creates a TagLogicalElement on the page.
      *
@@ -88,7 +77,7 @@
 
     /** {@inheritDoc} */
     protected void writeContent(OutputStream os) throws IOException {
-        writeObjects(tagLogicalElements, os);
+        writeObjects(tagLogicalElements, os, true);
         super.writeContent(os);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message