Browse Source

fixes duplicate id on overflow bug


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193452 13f79535-47bb-0310-9956-ffa450edef68
pull/32/head
Jordan Naftolin 24 years ago
parent
commit
4e6fdd8f60
1 changed files with 27 additions and 23 deletions
  1. 27
    23
      src/org/apache/fop/fo/FObjMixed.java

+ 27
- 23
src/org/apache/fop/fo/FObjMixed.java View File

@@ -61,43 +61,47 @@ import org.apache.fop.apps.FOPException;
public class FObjMixed extends FObj {

public static class Maker extends FObj.Maker {
public FObj make(FObj parent, PropertyList propertyList)
throws FOPException {
return new FObjMixed(parent, propertyList);
}
public FObj make(FObj parent, PropertyList propertyList)
throws FOPException {
return new FObjMixed(parent, propertyList);
}
}

public static FObj.Maker maker() {
return new FObjMixed.Maker();
return new FObjMixed.Maker();
}

protected FObjMixed(FObj parent, PropertyList propertyList) {
super(parent, propertyList);
super(parent, propertyList);
}

protected void addCharacters(char data[], int start, int length) {
children.addElement(new FOText(data,start,length,this));
children.addElement(new FOText(data,start,length,this));
}

public Status layout(Area area) throws FOPException {

if (this.marker == START) {
this.marker = 0;
// initialize id
String id = this.properties.get("id").getString();
area.getIDReferences().initializeID(id,area);
}
String id = this.properties.get("id").getString();

int numChildren = this.children.size();
for (int i = this.marker; i < numChildren; i++) {
FONode fo = (FONode) children.elementAt(i);
Status status;
if ((status = fo.layout(area)).isIncomplete()) {
this.marker = i;
return status;
}
}
return new Status(Status.OK);
if ( this.marker == START ) {
area.getIDReferences().createID(id);
this.marker = 0;
}

if ( this.marker == 0 ) {
area.getIDReferences().configureID(id,area);
}

int numChildren = this.children.size();
for ( int i = this.marker; i < numChildren; i++ ) {
FONode fo = (FONode) children.elementAt(i);
Status status;
if ( (status = fo.layout(area)).isIncomplete() ) {
this.marker = i;
return status;
}
}
return new Status(Status.OK);
}
}


Loading…
Cancel
Save