public static bool LayoutFootnote(Page p, FootnoteBody fb, Area area) { try { BodyAreaContainer bac = p.getBody(); AreaContainer footArea = bac.getFootnoteReferenceArea(); footArea.setIDReferences(bac.getIDReferences()); int basePos = footArea.GetCurrentYPosition() - footArea.GetHeight(); int oldHeight = footArea.GetHeight(); if (area != null) { footArea.setMaxHeight(area.getMaxHeight() - area.GetHeight() + footArea.GetHeight()); } else { footArea.setMaxHeight(bac.getMaxHeight() + footArea.GetHeight()); } Status status = fb.Layout(footArea); if (status.isIncomplete()) { return(false); } else { if (area != null) { area.setMaxHeight(area.getMaxHeight() - footArea.GetHeight() + oldHeight); } if (bac.getFootnoteState() == 0) { Area ar = bac.getMainReferenceArea(); DecreaseMaxHeight(ar, footArea.GetHeight() - oldHeight); footArea.setYPosition(basePos + footArea.GetHeight()); } } } catch (FonetException) { return(false); } return(true); }
public override Status Layout(Area area) { int originalAbsoluteHeight = area.getAbsoluteHeight(); if (this.marker == MarkerBreakAfter) { return(new Status(Status.OK)); } if (this.marker == MarkerStart) { area.getIDReferences().CreateID(id); this.marker = 0; this.bDone = false; } if (marker == 0) { area.getIDReferences().ConfigureID(id, area); } int spaceLeft = area.spaceLeft() - m_borderSeparation; this.cellArea = new AreaContainer(propMgr.GetFontState(area.getFontInfo()), startOffset + startAdjust, beforeOffset, width - widthAdjust, spaceLeft, Position.RELATIVE); cellArea.foCreator = this; cellArea.setPage(area.getPage()); cellArea.setParent(area); cellArea.setBorderAndPadding( (BorderAndPadding)propMgr.GetBorderAndPadding().Clone()); cellArea.setBackground(propMgr.GetBackgroundProps()); cellArea.start(); cellArea.setAbsoluteHeight(area.getAbsoluteHeight()); cellArea.setIDReferences(area.getIDReferences()); cellArea.setTableCellXOffset(startOffset + startAdjust); int numChildren = this.children.Count; for (int i = this.marker; bDone == false && i < numChildren; i++) { FObj fo = (FObj)children[i]; fo.SetIsInTableCell(); fo.ForceWidth(width); this.marker = i; Status status; if ((status = fo.Layout(cellArea)).isIncomplete()) { if ((i == 0) && (status.getCode() == Status.AREA_FULL_NONE)) { return(new Status(Status.AREA_FULL_NONE)); } else { area.addChild(cellArea); return(new Status(Status.AREA_FULL_SOME)); } } area.setMaxHeight(area.getMaxHeight() - spaceLeft + this.cellArea.getMaxHeight()); } this.bDone = true; cellArea.end(); area.addChild(cellArea); if (minCellHeight > cellArea.getContentHeight()) { cellArea.SetHeight(minCellHeight); } height = cellArea.GetHeight(); top = cellArea.GetCurrentYPosition(); return(new Status(Status.OK)); }
public virtual int GetYPosition() { return(areaContainer.GetCurrentYPosition()); }