You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2009/09/28 16:10:27 UTC

svn commit: r819542 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java status.xml

Author: jeremias
Date: Mon Sep 28 14:10:27 2009
New Revision: 819542

URL: http://svn.apache.org/viewvc?rev=819542&view=rev
Log:
Bugzilla #46883:
Reverting revision 807010 because it creates faulty GOCA data. Have debugged but haven't immediately found the cause. Due to time restrictions I'm currently just reverting the change to fix the regression.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java?rev=819542&r1=819541&r2=819542&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java Mon Sep 28 14:10:27 2009
@@ -46,8 +46,6 @@
     /** object has started */
     private boolean started = false;
 
-    private int dataLength = 0;
-
     /**
      * Default constructor
      */
@@ -80,7 +78,6 @@
      */
     public void addObject(StructuredData object) {
         objects.add(object);
-        dataLength += object.getDataLength();
     }
 
     /**
@@ -91,7 +88,6 @@
     public void addAll(AbstractGraphicsDrawingOrderContainer graphicsContainer) {
         Collection/*<StructuredDataObject>*/ objects = graphicsContainer.getObjects();
         objects.addAll(objects);
-        dataLength += graphicsContainer.getDataLength();
     }
 
     /**
@@ -111,11 +107,9 @@
     public StructuredData removeLast() {
         int lastIndex = objects.size() - 1;
         StructuredData object = null;
-        if (lastIndex >= 0) {
-            object = (StructuredData)objects.remove(lastIndex);
-        }
-        if (object != null) {
-            dataLength -= object.getDataLength();
+        if (lastIndex > -1) {
+            object = (StructuredData)objects.get(lastIndex);
+            objects.remove(lastIndex);
         }
         return object;
     }
@@ -127,7 +121,12 @@
      * all enclosed objects (and their containers)
      */
     public int getDataLength() {
-        return this.dataLength;
+        int dataLen = 0;
+        Iterator it = objects.iterator();
+        while (it.hasNext()) {
+            dataLen += ((StructuredData)it.next()).getDataLength();
+        }
+        return dataLen;
     }
 
     /** {@inheritDoc} */

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=819542&r1=819541&r2=819542&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Mon Sep 28 14:10:27 2009
@@ -69,10 +69,6 @@
       <action context="Renderers" dev="AD" type="add" fixes-bug="46905">
         Added basic implementation for column-keeps.
       </action>
-      <action context="Renderers" dev="AD" type="fix" fixes-bug="46883">
-        Hotspot in AbstractGraphicsDrawingOrderContainer. Reduced time spent in the method
-        by introducing a member variable to hold the data-length.
-      </action>
       <action context="Code" dev="AD" type="fix" fixes-bug="47710">
         White-space handling in markers with inline-content throws a NullPointerException
         in some cases.



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