*/
public void doLayout(int flowBPD, boolean autoHeight) {
LayoutContext childLC = createLayoutContext();
- childLC.setStackLimit(new MinOptMax(flowBPD));
+ childLC.setStackLimitBP(new MinOptMax(flowBPD));
if (getCurrentDisplayAlign() == Constants.EN_X_FILL) {
//EN_X_FILL is non-standard (by LF)
int averageLineLength = optimizeLineLength(effectiveList,
startElementIndex, endElementIndex);
if (averageLineLength != 0) {
- childLC.setStackLimit(new MinOptMax(averageLineLength));
+ childLC.setStackLimitBP(new MinOptMax(averageLineLength));
}
}
/* *** *** non-standard extension *** *** */
// set space after for each LM, in order to implement
// display-align = distribute
lc.setSpaceAfter(layoutContext.getSpaceAfter());
- lc.setStackLimit(layoutContext.getStackLimit());
+ lc.setStackLimitsFrom(layoutContext);
childLM.addAreas(childPosIter, lc);
}
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.flow.BlockContainer;
import org.apache.fop.fo.properties.CommonAbsolutePosition;
-import org.apache.fop.layoutmgr.inline.InlineLayoutManager;
import org.apache.fop.traits.MinOptMax;
import org.apache.fop.traits.SpaceVal;
= (getBlockContainerFO().getReferenceOrientation() % 180 != 0);
autoHeight = false;
//boolean rotated = (getBlockContainerFO().getReferenceOrientation() % 180 != 0);
- int maxbpd = context.getStackLimit().opt;
+ int maxbpd = context.getStackLimitBP().opt;
int allocBPD;
if (height.getEnum() == EN_AUTO
|| (!height.isAbsolute() && getAncestorBlockAreaBPD() <= 0)) {
LayoutContext childLC = new LayoutContext(0);
childLC.copyPendingMarksFrom(context);
// curLM is a ?
- childLC.setStackLimit(MinOptMax.subtract(context
- .getStackLimit(), stackLimit));
+ childLC.setStackLimitBP(MinOptMax.subtract(context.getStackLimitBP(), stackLimit));
childLC.setRefIPD(relDims.ipd);
childLC.setWritingMode(getBlockContainerFO().getWritingMode());
if (isFixed()) {
availHeight = (int)getCurrentPV().getViewArea().getHeight();
} else {
- availHeight = context.getStackLimit().opt;
+ availHeight = context.getStackLimitBP().opt;
}
allocBPD = availHeight;
allocBPD -= offset.y;
}
}
} else {
- int maxbpd = context.getStackLimit().opt;
+ int maxbpd = context.getStackLimitBP().opt;
allocBPD = maxbpd;
if (!switchedProgressionDirection) {
autoHeight = true;
while ((curLM = getChildLM()) != null) {
LayoutContext childLC = new LayoutContext(0);
- childLC.setStackLimit(context.getStackLimit());
+ childLC.setStackLimitBP(context.getStackLimitBP());
childLC.setRefIPD(context.getRefIPD());
childLC.setWritingMode(getBlockContainerFO().getWritingMode());
// set last area flag
lc.setFlags(LayoutContext.LAST_AREA,
(layoutContext.isLastArea() && childLM == lastLM));
- /*LF*/lc.setStackLimit(layoutContext.getStackLimit());
+ /*LF*/lc.setStackLimitBP(layoutContext.getStackLimitBP());
// Add the line areas to Area
childLM.addAreas(childPosIter, lc);
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public boolean mustKeepTogether() {
//TODO Keeps will have to be more sophisticated sooner or later
- return (!getBlockContainerFO().getKeepTogether().getWithinPage().isAuto()
- || !getBlockContainerFO().getKeepTogether().getWithinColumn().isAuto()
- || (getParent() instanceof BlockLevelLayoutManager
- && ((BlockLevelLayoutManager) getParent()).mustKeepTogether())
- || (getParent() instanceof InlineLayoutManager
- && ((InlineLayoutManager) getParent()).mustKeepTogether()));
+ return super.mustKeepTogether()
+ || !getBlockContainerFO().getKeepTogether().getWithinPage().isAuto()
+ || !getBlockContainerFO().getKeepTogether().getWithinColumn().isAuto();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public boolean mustKeepWithPrevious() {
return !getBlockContainerFO().getKeepWithPrevious().getWithinPage().isAuto()
|| !getBlockContainerFO().getKeepWithPrevious().getWithinColumn().isAuto();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public boolean mustKeepWithNext() {
return !getBlockContainerFO().getKeepWithNext().getWithinPage().isAuto()
|| !getBlockContainerFO().getKeepWithNext().getWithinColumn().isAuto();
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.area.Area;
import org.apache.fop.area.Block;
import org.apache.fop.area.LineArea;
// set last area flag
lc.setFlags(LayoutContext.LAST_AREA,
(layoutContext.isLastArea() && childLM == lastLM));
- lc.setStackLimit(layoutContext.getStackLimit());
+ lc.setStackLimitBP(layoutContext.getStackLimitBP());
// Add the line areas to Area
childLM.addAreas(childPosIter, lc);
}
if (curLM instanceof LineLayoutManager) {
// curLM is a LineLayoutManager
// set stackLimit for lines (stack limit is now i-p-direction, not b-p-direction!)
- childLC.setStackLimit(new MinOptMax(getContentAreaIPD()));
+ childLC.setStackLimitBP(context.getStackLimitBP());
+ childLC.setStackLimitIP(new MinOptMax(getContentAreaIPD()));
childLC.setRefIPD(getContentAreaIPD());
} else {
// curLM is a ?
//childLC.setStackLimit(MinOptMax.subtract(context
// .getStackLimit(), stackSize));
- childLC.setStackLimit(context.getStackLimit());
+ childLC.setStackLimitBP(context.getStackLimitBP());
childLC.setRefIPD(referenceIPD);
}
//MinOptMax bpd = context.getStackLimit();
LayoutContext childLC = new LayoutContext(0);
- childLC.setStackLimit(context.getStackLimit());
+ childLC.setStackLimitBP(context.getStackLimitBP());
childLC.setRefIPD(context.getRefIPD());
childLC.setWritingMode(getCurrentPage().getSimplePageMaster().getWritingMode());
private int flags; // Contains some set of flags defined above
/**
* Total available stacking dimension for a "galley-level" layout
- * manager (Line or Flow). It is passed by the parent LM. For LineLM,
- * the block LM determines this based on indent properties.
+ * manager in block-progression-direction. It is passed by the
+ * parent LM.
* These LM <b>may</b> wish to pass this information down to lower
* level LM to allow them to optimize returned break possibilities.
*/
- private MinOptMax stackLimit;
+ private MinOptMax stackLimitBP;
+ /**
+ * Total available stacking dimension for a "galley-level" layout
+ * manager in inline-progression-direction. It is passed by the
+ * parent LM. For LineLM, the block LM determines this based on
+ * indent properties.
+ * These LM <b>may</b> wish to pass this information down to lower
+ * level LM to allow them to optimize returned break possibilities.
+ */
+ private MinOptMax stackLimitIP;
/** True if current element list is spanning in multi-column layout. */
private int nextSpan = Constants.NOT_SET;
this.flags = parentLC.flags;
this.refIPD = parentLC.refIPD;
this.writingMode = parentLC.writingMode;
- this.stackLimit = null; // Don't reference parent MinOptMax!
+ setStackLimitsFrom(parentLC);
this.leadingSpace = parentLC.leadingSpace; //???
this.trailingSpace = parentLC.trailingSpace; //???
this.hyphContext = parentLC.hyphContext;
public LayoutContext(int flags) {
this.flags = flags;
this.refIPD = 0;
- stackLimit = new MinOptMax(0);
+ stackLimitBP = new MinOptMax(0);
+ stackLimitIP = new MinOptMax(0);
leadingSpace = null;
trailingSpace = null;
}
}
}
- public void setStackLimit(MinOptMax limit) {
- stackLimit = limit;
+ /**
+ * Sets the stack limit in block-progression-dimension.
+ * @param limit the stack limit
+ */
+ public void setStackLimitBP(MinOptMax limit) {
+ stackLimitBP = limit;
}
- public MinOptMax getStackLimit() {
- return stackLimit;
+ /**
+ * Returns the stack limit in block-progression-dimension.
+ * @return the stack limit
+ */
+ public MinOptMax getStackLimitBP() {
+ return stackLimitBP;
}
+ /**
+ * Sets the stack limit in inline-progression-dimension.
+ * @param limit the stack limit
+ */
+ public void setStackLimitIP(MinOptMax limit) {
+ stackLimitIP = limit;
+ }
+
+ /**
+ * Returns the stack limit in inline-progression-dimension.
+ * @return the stack limit
+ */
+ public MinOptMax getStackLimitIP() {
+ return stackLimitIP;
+ }
+
+ /**
+ * Sets (Copies) the stack limits in both directions from another layout context.
+ * @param context the layout context to taje the values from
+ */
+ public void setStackLimitsFrom(LayoutContext context) {
+ setStackLimitBP(context.getStackLimitBP());
+ setStackLimitIP(context.getStackLimitIP());
+ }
+
/**
* Sets the inline-progression-dimension of the nearest ancestor reference area.
*/
/** {@inheritDoc} */
public String toString() {
- return "Layout Context:" +
- "\nStack Limit: \t" + (getStackLimit() == null ? "null" : getStackLimit().toString()) +
- "\nTrailing Space: \t" + (getTrailingSpace() == null ? "null" : getTrailingSpace().toString()) +
- "\nLeading Space: \t" + (getLeadingSpace() == null ? "null" : getLeadingSpace().toString()) +
- "\nReference IPD: \t" + getRefIPD() +
- "\nSpace Adjust: \t" + getSpaceAdjust() +
- "\nIPD Adjust: \t" + getIPDAdjust() +
- "\nResolve Leading Space: \t" + resolveLeadingSpace() +
- "\nSuppress Leading Space: \t" + suppressLeadingSpace() +
- "\nIs First Area: \t" + isFirstArea() +
- "\nStarts New Area: \t" + startsNewArea() +
- "\nIs Last Area: \t" + isLastArea() +
- "\nTry Hyphenate: \t" + tryHyphenate() +
- "\nKeeps: \t[" + (isKeepWithNextPending() ? "keep-with-next" : "") + "]["
- + (isKeepWithPreviousPending() ? "keep-with-previous" : "") + "] pending" +
- "\nBreaks: \tforced [" + (breakBefore != Constants.EN_AUTO ? "break-before" : "") + "]["
+ return "Layout Context:"
+ + "\nStack Limit BPD: \t"
+ + (getStackLimitBP() == null ? "null" : getStackLimitBP().toString())
+ + "\nStack Limit IPD: \t"
+ + (getStackLimitIP() == null ? "null" : getStackLimitIP().toString())
+ + "\nTrailing Space: \t"
+ + (getTrailingSpace() == null ? "null" : getTrailingSpace().toString())
+ + "\nLeading Space: \t"
+ + (getLeadingSpace() == null ? "null" : getLeadingSpace().toString())
+ + "\nReference IPD: \t" + getRefIPD()
+ + "\nSpace Adjust: \t" + getSpaceAdjust()
+ + "\nIPD Adjust: \t" + getIPDAdjust()
+ + "\nResolve Leading Space: \t" + resolveLeadingSpace()
+ + "\nSuppress Leading Space: \t" + suppressLeadingSpace()
+ + "\nIs First Area: \t" + isFirstArea()
+ + "\nStarts New Area: \t" + startsNewArea()
+ + "\nIs Last Area: \t" + isLastArea()
+ + "\nTry Hyphenate: \t" + tryHyphenate()
+ + "\nKeeps: \t[" + (isKeepWithNextPending() ? "keep-with-next" : "") + "]["
+ + (isKeepWithPreviousPending() ? "keep-with-previous" : "") + "] pending"
+ + "\nBreaks: \tforced [" + (breakBefore != Constants.EN_AUTO ? "break-before" : "") + "]["
+ (breakAfter != Constants.EN_AUTO ? "break-after" : "") + "]";
}
// element represents a line with footnote citations
bFootnotesPresent = true;
LayoutContext footnoteContext = new LayoutContext(context);
- footnoteContext.setStackLimit(context.getStackLimit());
+ footnoteContext.setStackLimitBP(context.getStackLimitBP());
footnoteContext.setRefIPD(pslm.getCurrentPV()
.getRegionReference(Constants.FO_REGION_BODY).getIPD());
LinkedList footnoteBodyLMs = ((KnuthBlockBox) element).getFootnoteBodyLMs();
//TODO Empty this method?!?
// set layout dimensions
setContentAreaIPD(context.getRefIPD());
- setContentAreaBPD(context.getStackLimit().opt);
+ setContentAreaBPD(context.getStackLimitBP().opt);
//TODO Copied from elsewhere. May be worthwhile to factor out the common parts.
// currently active LM
}
// Set up a LayoutContext
- MinOptMax bpd = context.getStackLimit();
+ MinOptMax bpd = context.getStackLimitBP();
LayoutContext childLC = new LayoutContext(0);
- childLC.setStackLimit(MinOptMax.subtract(bpd, stackSize));
+ childLC.setStackLimitBP(MinOptMax.subtract(bpd, stackSize));
childLC.setRefIPD(context.getRefIPD());
// get elements from curLM
while ((curLM = getChildLM()) != null) {
LayoutContext childLC = new LayoutContext(0);
- childLC.setStackLimit(context.getStackLimit());
+ childLC.setStackLimitBP(context.getStackLimitBP());
childLC.setRefIPD(context.getRefIPD());
childLC.setWritingMode(context.getWritingMode());
package org.apache.fop.layoutmgr.inline;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.area.Area;
+import org.apache.fop.area.Block;
+import org.apache.fop.area.LineArea;
+import org.apache.fop.area.inline.InlineArea;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.pagination.Title;
import org.apache.fop.layoutmgr.AbstractBaseLayoutManager;
import org.apache.fop.layoutmgr.Position;
import org.apache.fop.layoutmgr.PositionIterator;
import org.apache.fop.layoutmgr.SpaceSpecifier;
-import org.apache.fop.area.Area;
-import org.apache.fop.area.LineArea;
-import org.apache.fop.area.inline.InlineArea;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.ArrayList;
-import java.util.Iterator;
import org.apache.fop.traits.MinOptMax;
-import org.apache.fop.area.Block;
-
/**
* Content Layout Manager.
* For use with objects that contain inline areas such as
childLC.setLeadingSpace(new SpaceSpecifier(false));
childLC.setTrailingSpace(new SpaceSpecifier(false));
// set stackLimit for lines
- childLC.setStackLimit(new MinOptMax(ipd));
+ childLC.setStackLimitIP(new MinOptMax(ipd));
childLC.setRefIPD(ipd);
int lineHeight = 14000;
package org.apache.fop.layoutmgr.inline;
-import java.util.ListIterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.ListIterator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.area.Area;
import org.apache.fop.area.inline.InlineArea;
import org.apache.fop.area.inline.InlineBlockParent;
import org.apache.fop.layoutmgr.KnuthBox;
import org.apache.fop.layoutmgr.KnuthSequence;
import org.apache.fop.layoutmgr.LayoutContext;
-import org.apache.fop.layoutmgr.NonLeafPosition;
-import org.apache.fop.layoutmgr.SpaceSpecifier;
-import org.apache.fop.layoutmgr.TraitSetter;
import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.NonLeafPosition;
import org.apache.fop.layoutmgr.Position;
import org.apache.fop.layoutmgr.PositionIterator;
+import org.apache.fop.layoutmgr.SpaceSpecifier;
+import org.apache.fop.layoutmgr.TraitSetter;
import org.apache.fop.traits.MinOptMax;
import org.apache.fop.traits.SpaceVal;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.area.Area;
import org.apache.fop.area.LineArea;
import org.apache.fop.area.Trait;
// Set up constraints for inline level managers
// IPD remaining in line
- MinOptMax availIPD = context.getStackLimit();
+ MinOptMax availIPD = context.getStackLimitIP();
clearPrevIPD();
InlineLevelLayoutManager curLM;
LinkedList returnedList = null;
- iLineWidth = context.getStackLimit().opt;
+ iLineWidth = context.getStackLimitIP().opt;
// convert all the text in a sequence of paragraphs made
// of KnuthBox, KnuthGlue and KnuthPenalty objects
*/
if (false && textAlignment == EN_JUSTIFY) {
// re-compute space adjust ratio
- int updatedDifference = context.getStackLimit().opt
+ int updatedDifference = context.getStackLimitIP().opt
- lbp.lineWidth + lbp.difference;
double updatedRatio = 0.0;
if (updatedDifference > 0) {
} else if (false && textAlignment == EN_CENTER) {
// re-compute indent
int updatedIndent = lbp.startIndent
- + (context.getStackLimit().opt - lbp.lineWidth) / 2;
+ + (context.getStackLimitIP().opt - lbp.lineWidth) / 2;
lineArea.addTrait(Trait.START_INDENT, new Integer(updatedIndent));
} else if (false && textAlignment == EN_END) {
// re-compute indent
int updatedIndent = lbp.startIndent
- + (context.getStackLimit().opt - lbp.lineWidth);
+ + (context.getStackLimitIP().opt - lbp.lineWidth);
lineArea.addTrait(Trait.START_INDENT, new Integer(updatedIndent));
}
// set last area flag
blocklc.setFlags(LayoutContext.LAST_AREA,
(context.isLastArea() && childLM == lastLM));
- blocklc.setStackLimit(context.getStackLimit());
+ blocklc.setStackLimitsFrom(context);
// Add the line areas to Area
childLM.addAreas(childPosIter, blocklc);
blocklc.setLeadingSpace(blocklc.getTrailingSpace());
package org.apache.fop.layoutmgr.list;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
+import org.apache.fop.area.Area;
+import org.apache.fop.area.Block;
import org.apache.fop.fo.flow.ListBlock;
-import org.apache.fop.layoutmgr.BlockLevelLayoutManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
import org.apache.fop.layoutmgr.ConditionalElementListener;
import org.apache.fop.layoutmgr.ElementListUtils;
-import org.apache.fop.layoutmgr.LayoutManager;
import org.apache.fop.layoutmgr.LayoutContext;
-import org.apache.fop.layoutmgr.PositionIterator;
-import org.apache.fop.layoutmgr.Position;
+import org.apache.fop.layoutmgr.LayoutManager;
import org.apache.fop.layoutmgr.NonLeafPosition;
+import org.apache.fop.layoutmgr.Position;
+import org.apache.fop.layoutmgr.PositionIterator;
import org.apache.fop.layoutmgr.RelSide;
import org.apache.fop.layoutmgr.TraitSetter;
-import org.apache.fop.area.Area;
-import org.apache.fop.area.Block;
import org.apache.fop.traits.MinOptMax;
import org.apache.fop.traits.SpaceVal;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
/**
* LayoutManager for a list-block FO.
* A list block contains list items which are stacked within
lc.setSpaceAdjust(layoutContext.getSpaceAdjust());
lc.setFlags(LayoutContext.FIRST_AREA, childLM == firstLM);
lc.setFlags(LayoutContext.LAST_AREA, childLM == lastLM);
- lc.setStackLimit(layoutContext.getStackLimit());
+ lc.setStackLimitBP(layoutContext.getStackLimitBP());
childLM.addAreas(childPosIter, lc);
}
/** {@inheritDoc} */
public boolean mustKeepTogether() {
//TODO Keeps will have to be more sophisticated sooner or later
- return ((BlockLevelLayoutManager)getParent()).mustKeepTogether()
+ return super.mustKeepTogether()
|| !getListBlockFO().getKeepTogether().getWithinPage().isAuto()
|| !getListBlockFO().getKeepTogether().getWithinColumn().isAuto();
}
package org.apache.fop.layoutmgr.list;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.fop.area.Area;
+import org.apache.fop.area.Block;
import org.apache.fop.fo.flow.AbstractListItemPart;
import org.apache.fop.fo.flow.ListItemBody;
import org.apache.fop.fo.flow.ListItemLabel;
import org.apache.fop.layoutmgr.BlockLevelLayoutManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
-import org.apache.fop.layoutmgr.LayoutManager;
import org.apache.fop.layoutmgr.LayoutContext;
-import org.apache.fop.layoutmgr.PositionIterator;
-import org.apache.fop.layoutmgr.Position;
+import org.apache.fop.layoutmgr.LayoutManager;
import org.apache.fop.layoutmgr.NonLeafPosition;
+import org.apache.fop.layoutmgr.Position;
+import org.apache.fop.layoutmgr.PositionIterator;
import org.apache.fop.layoutmgr.TraitSetter;
import org.apache.fop.layoutmgr.SpaceResolver.SpaceHandlingBreakPosition;
-import org.apache.fop.area.Area;
-import org.apache.fop.area.Block;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.LinkedList;
/**
* LayoutManager for a list-item-label or list-item-body FO.
lc.setFlags(LayoutContext.LAST_AREA, childLM == lastLM);
// set the space adjustment ratio
lc.setSpaceAdjust(layoutContext.getSpaceAdjust());
- lc.setStackLimit(layoutContext.getStackLimit());
+ lc.setStackLimitBP(layoutContext.getStackLimitBP());
childLM.addAreas(childPosIter, lc);
}
package org.apache.fop.layoutmgr.list;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
+import org.apache.fop.area.Area;
+import org.apache.fop.area.Block;
import org.apache.fop.fo.flow.ListItem;
import org.apache.fop.fo.flow.ListItemBody;
import org.apache.fop.fo.flow.ListItemLabel;
import org.apache.fop.layoutmgr.ConditionalElementListener;
import org.apache.fop.layoutmgr.ElementListObserver;
import org.apache.fop.layoutmgr.ElementListUtils;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.KnuthBox;
+import org.apache.fop.layoutmgr.KnuthElement;
+import org.apache.fop.layoutmgr.KnuthPenalty;
+import org.apache.fop.layoutmgr.KnuthPossPosIter;
import org.apache.fop.layoutmgr.LayoutContext;
-import org.apache.fop.layoutmgr.PositionIterator;
-import org.apache.fop.layoutmgr.Position;
+import org.apache.fop.layoutmgr.LayoutManager;
import org.apache.fop.layoutmgr.NonLeafPosition;
+import org.apache.fop.layoutmgr.Position;
+import org.apache.fop.layoutmgr.PositionIterator;
import org.apache.fop.layoutmgr.RelSide;
import org.apache.fop.layoutmgr.SpaceResolver;
import org.apache.fop.layoutmgr.TraitSetter;
-import org.apache.fop.layoutmgr.KnuthElement;
-import org.apache.fop.layoutmgr.KnuthBox;
-import org.apache.fop.layoutmgr.KnuthPenalty;
-import org.apache.fop.layoutmgr.KnuthPossPosIter;
-import org.apache.fop.area.Area;
-import org.apache.fop.area.Block;
import org.apache.fop.traits.MinOptMax;
import org.apache.fop.traits.SpaceVal;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.ListIterator;
-
/**
* LayoutManager for a list-item FO.
* The list item contains a list item label and a list item body.
return iBodyLastIndex;
}
+ /** {@inheritDoc} */
+ public boolean generatesAreas() {
+ return true;
+ }
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer("ListItemPosition:");
// set the space adjustment ratio
lc.setSpaceAdjust(layoutContext.getSpaceAdjust());
// TO DO: use the right stack limit for the label
- lc.setStackLimit(layoutContext.getStackLimit());
+ lc.setStackLimitBP(layoutContext.getStackLimitBP());
label.addAreas(labelIter, lc);
}
// set the space adjustment ratio
lc.setSpaceAdjust(layoutContext.getSpaceAdjust());
// TO DO: use the right stack limit for the body
- lc.setStackLimit(layoutContext.getStackLimit());
+ lc.setStackLimitBP(layoutContext.getStackLimitBP());
body.addAreas(bodyIter, lc);
}
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.flow.table.EffRow;
}
}
LayoutContext childLC = new LayoutContext(0);
- childLC.setStackLimit(context.getStackLimit()); //necessary?
+ childLC.setStackLimitBP(context.getStackLimitBP()); //necessary?
childLC.setRefIPD(spanWidth);
//Get the element list for the cell contents
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.area.Area;
import org.apache.fop.area.Block;
import org.apache.fop.area.Trait;
* {@inheritDoc}
*/
public LinkedList getNextKnuthElements(LayoutContext context, int alignment) {
- MinOptMax stackLimit = new MinOptMax(context.getStackLimit());
+ MinOptMax stackLimit = new MinOptMax(context.getStackLimitBP());
referenceIPD = context.getRefIPD();
cellIPD = referenceIPD;
while ((curLM = (BlockLevelLayoutManager) getChildLM()) != null) {
LayoutContext childLC = new LayoutContext(0);
// curLM is a ?
- childLC.setStackLimit(MinOptMax.subtract(context
- .getStackLimit(), stackLimit));
+ childLC.setStackLimitBP(MinOptMax.subtract(context
+ .getStackLimitBP(), stackLimit));
childLC.setRefIPD(cellIPD);
// get elements from curLM
}
}
+ /** {@inheritDoc} */
public boolean generatesAreas() {
return true;
}
+ /** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer("TableContentPosition:");
sb.append(getIndex());
super(lm);
}
+ /** {@inheritDoc} */
+ public boolean generatesAreas() {
+ return true;
+ }
+
public String toString() {
StringBuffer sb = new StringBuffer("TableHFPenaltyPosition:");
sb.append(getIndex()).append("(");
this.nestedElements = nestedElements;
}
+ /** {@inheritDoc} */
+ public boolean generatesAreas() {
+ return true;
+ }
+
public String toString() {
StringBuffer sb = new StringBuffer("Table");
sb.append(header ? "Header" : "Footer");
</p>
</section>
</notes>
+ <action context="Layout" dev="JM" type="fix">
+ Fixed exceptions when lists, tables or block-container are children of an inline-level
+ FO.
+ </action>
<action context="Layout" dev="VH" type="add" importance="high">
Added support for background on fo:table-column and fo:table-header/footer/body elements.
</action>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:inline and nested block-level nodes.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="6in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>
+ <fo:inline>before
+ <fo:list-block>
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block>•</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block id="list-item-body1">Inline list item one.</fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </fo:list-block>
+ after</fo:inline>
+ </fo:block>
+ <fo:block space-before="0.5em">
+ <fo:inline>before
+ <fo:table table-layout="fixed" width="100%">
+ <fo:table-column column-width="proportional-column-width(1)"
+ number-columns-repeated="2"/>"
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell id="table-cell1">
+ <fo:block>cell1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell>
+ <fo:block>cell2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ after</fo:inline>
+ </fo:block>
+ <fo:block space-before="0.5em">
+ <fo:inline>before
+ <fo:block-container>
+ <fo:block id="block-in-bc">block in block-container</fo:block>
+ </fo:block-container>
+ after</fo:inline>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <element-list category="breaker">
+ <box w="14400"/>
+ <penalty w="0" p="0"/>
+ <box w="14400"/>
+ <penalty w="0" p="0"/>
+ <box w="14400"/>
+ <penalty w="0" p="0"/>
+ <glue w="6000" aux="true"/>
+ <box w="14400"/>
+ <penalty w="0" p="0"/>
+ <box w="14400"/>
+ <penalty w="0" p="0"/>
+ <box w="14400"/>
+ <penalty w="0" p="0"/>
+ <glue w="6000" aux="true"/>
+ <box w="14400"/>
+ <penalty w="0" p="0"/>
+ <box w="14400"/>
+ <penalty w="0" p="0"/>
+ <box w="14400"/>
+ <skip>3</skip>
+ </element-list>
+ <true xpath="boolean(//block[@prod-id='list-item-body1'])"/>
+ <true xpath="boolean(//block[@prod-id='table-cell1'])"/>
+ <true xpath="boolean(//block[@prod-id='block-in-bc'])"/>
+ </checks>
+</testcase>