row.setColumns(columns);
row.doSetup(areaContainer);
if (row.getKeepWithPrevious() != 0 && lastRow != null &&
- keepWith.indexOf(lastRow) != -1) {
+ keepWith.indexOf(lastRow) == -1) {
keepWith.addElement(lastRow);
}
return new Status(Status.OK);
}
- public int getAreaHeight() {
+/* public int getAreaHeight() {
return areaContainer.getHeight();
- }
+ }*/
public void removeLayout(Area area) {
area.removeChild(areaContainer);
+ if (spaceBefore != 0) {
+ area.increaseHeight(-spaceBefore);
+ }
+ if (spaceAfter != 0) {
+ area.increaseHeight(-spaceAfter);
+ }
this.resetMarker();
}
}
// added by Dresdner Bank, Germany
DisplaySpace spacer = null;
+ boolean hasAddedSpacer = false;
DisplaySpace spacerAfter = null;
/**
this.marker = 0;
}
-
if ((spaceBefore != 0) && (this.marker == 0)) {
spacer = new DisplaySpace(spaceBefore);
area.increaseHeight(spaceBefore);
}
} else {
// added on 11/28/2000, by Dresdner Bank, Germany
- if (spacer != null)
+ if (hasAddedSpacer && spacer != null)
area.removeChild(spacer);
+ hasAddedSpacer = false;
if(spacerAfter != null)
area.removeChild(spacerAfter);
}
// added by Dresdner Bank, Germany
- if (spacer != null) {
+ if (!hasAddedSpacer && spacer != null) {
area.addChild(spacer);
- spacer = null;
+ hasAddedSpacer = true;
}
area.addChild(areaContainer);
// bug fix from Eric Schaeffer
//area.increaseHeight(largestCellHeight);
- if (spaceAfter != 0) {
- spacerAfter = new DisplaySpace(spaceAfter);
- area.increaseHeight(spaceAfter);
- area.addChild(spacerAfter);
- }
-
- if (area instanceof BlockArea) {
- area.start();
- }
-
// test to see if some cells are not
// completely laid out.
// Hani Elabed 11/22/2000
}
}
+ if (!someCellDidNotLayoutCompletely && spaceAfter != 0) {
+ spacerAfter = new DisplaySpace(spaceAfter);
+ area.increaseHeight(spaceAfter);
+ area.addChild(spacerAfter);
+ }
+
+ if (area instanceof BlockArea) {
+ area.start();
+ }
+
// replaced by Hani Elabed 11/27/2000
//return new Status(Status.OK);
}
public void removeLayout(Area area) {
- if (spacer != null)
- area.removeChild(spacer);
+ if (spacer != null) {
+ if(hasAddedSpacer) {
+ area.removeChild(spacer);
+ } else {
+ area.increaseHeight(-spaceBefore);
+ }
+ }
+ hasAddedSpacer = false;
if(spacerAfter != null)
area.removeChild(spacerAfter);
- // removing something that was added by succession
- // of cell.layout()
- // just to keep my sanity here, Hani
- // area.increaseHeight(areaContainer.getHeight());
+ //area.increaseHeight(areaContainer.getHeight());
area.removeChild(areaContainer);
this.resetMarker();
cells = null;
this.removeID(area.getIDReferences());
}
+
+ public void resetMarker()
+ {
+ super.resetMarker();
+ spacer = null;
+ spacerAfter = null;
+ hasAddedSpacer = false;
+ }
}