diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/LayoutContext.java | 19 | ||||
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java | 16 |
2 files changed, 30 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutContext.java b/src/java/org/apache/fop/layoutmgr/LayoutContext.java index 76efe2175..0f50acf46 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutContext.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutContext.java @@ -95,7 +95,6 @@ public class LayoutContext { */ MinOptMax stackLimit; - /** True if current top-level reference area is spanning. */ boolean bIsSpan; @@ -256,5 +255,23 @@ public class LayoutContext { public int getBaseline() { return iBaseline; } + + 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() + + "\nLine Height: \t" + getLineHeight() + + "\nBaseline: \t" + getBaseline() + + "\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(); + } } diff --git a/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java b/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java index 816e97cae..1bf8e7bcb 100644 --- a/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java +++ b/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java @@ -63,17 +63,17 @@ import org.apache.fop.traits.MinOptMax; public class SpaceSpecifier implements Cloneable { - private boolean bStartsRefArea; + private boolean bStartsReferenceArea; private boolean bHasForcing = false; private List vecSpaceVals = new java.util.ArrayList(); /** * Creates a new SpaceSpecifier. - * @param bStarts true if it starts anew reference area + * @param bStarts true if it starts a new reference area */ public SpaceSpecifier(boolean bStarts) { - bStartsRefArea = bStarts; + bStartsReferenceArea = bStarts; } /** @@ -82,6 +82,8 @@ public class SpaceSpecifier implements Cloneable { public Object clone() { try { SpaceSpecifier ss = (SpaceSpecifier) super.clone(); + ss.bStartsReferenceArea = this.bStartsReferenceArea; + ss.bHasForcing = this.bHasForcing; // Clone the vector, but share the objects in it! ss.vecSpaceVals = new ArrayList(); ss.vecSpaceVals.addAll(this.vecSpaceVals); @@ -115,7 +117,7 @@ public class SpaceSpecifier implements Cloneable { * add it to the sequence. */ public void addSpace(SpaceVal moreSpace) { - if (!bStartsRefArea + if (!bStartsReferenceArea || !moreSpace.isConditional() || !vecSpaceVals.isEmpty()) { if (moreSpace.isForcing()) { @@ -182,4 +184,10 @@ public class SpaceSpecifier implements Cloneable { } return resSpace; } + + public String toString() { + return "Space Specifier (resolved at begin/end of ref. area:):\n" + + resolve(false).toString() + "\n" + + resolve(true).toString(); + } } |