aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/afp
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2009-09-28 14:10:27 +0000
committerJeremias Maerki <jeremias@apache.org>2009-09-28 14:10:27 +0000
commitf8f3edf87a9bbc36acee9d5161be9b3a7ffa02e4 (patch)
tree8fa997aa4067d2225907bca4f13601726b1813d7 /src/java/org/apache/fop/afp
parent2d26284592d2d7e31e1c28e94d230d6166f8ef3e (diff)
downloadxmlgraphics-fop-f8f3edf87a9bbc36acee9d5161be9b3a7ffa02e4.tar.gz
xmlgraphics-fop-f8f3edf87a9bbc36acee9d5161be9b3a7ffa02e4.zip
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. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@819542 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/afp')
-rw-r--r--src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java b/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java
index dbeaa26d0..a158fbe8f 100644
--- a/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java
+++ b/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java
@@ -46,8 +46,6 @@ implements StructuredData, Completable, Startable {
/** object has started */
private boolean started = false;
- private int dataLength = 0;
-
/**
* Default constructor
*/
@@ -80,7 +78,6 @@ implements StructuredData, Completable, Startable {
*/
public void addObject(StructuredData object) {
objects.add(object);
- dataLength += object.getDataLength();
}
/**
@@ -91,7 +88,6 @@ implements StructuredData, Completable, Startable {
public void addAll(AbstractGraphicsDrawingOrderContainer graphicsContainer) {
Collection/*<StructuredDataObject>*/ objects = graphicsContainer.getObjects();
objects.addAll(objects);
- dataLength += graphicsContainer.getDataLength();
}
/**
@@ -111,11 +107,9 @@ implements StructuredData, Completable, Startable {
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 @@ implements StructuredData, Completable, Startable {
* 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} */