aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2013-11-07 12:29:17 +0000
committerVincent Hennebert <vhennebert@apache.org>2013-11-07 12:29:17 +0000
commit6e65f409038594b64900780044fc5e94a84504e3 (patch)
treeb73f6c3d9579ed5c3fc08fcccce0cfea0aea552e /src/java
parent89b34550c9bb72ba8dcf01e09038ad11ec5757f6 (diff)
downloadxmlgraphics-fop-6e65f409038594b64900780044fc5e94a84504e3.tar.gz
xmlgraphics-fop-6e65f409038594b64900780044fc5e94a84504e3.zip
Added support for alignment-baseline on fo:inline-container
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_InlineContainer@1539611 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
index 626ce8209..b043268bd 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
@@ -57,7 +57,6 @@ import org.apache.fop.layoutmgr.TraitSetter;
public class InlineContainerLayoutManager extends AbstractLayoutManager implements InlineLevelLayoutManager {
private CommonBorderPaddingBackground borderProps;
- private int alignmentBaseline = EN_BASELINE;
private int contentAreaIPD;
private int contentAreaBPD;
@@ -77,6 +76,11 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
borderProps = node.getCommonBorderPaddingBackground();
}
+ private InlineContainer getInlineContainer() {
+ assert fobj instanceof InlineContainer;
+ return (InlineContainer) fobj;
+ }
+
@Override
public List<KnuthSequence> getNextKnuthElements(LayoutContext context, int alignment) {
determineIPD(context);
@@ -95,7 +99,7 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
}
private void determineIPD(LayoutContext layoutContext) {
- LengthRangeProperty ipd = ((InlineContainer) fobj).getInlineProgressionDimension();
+ LengthRangeProperty ipd = getInlineContainer().getInlineProgressionDimension();
Property optimum = ipd.getOptimum(this);
if (optimum.isAuto()) {
contentAreaIPD = layoutContext.getRefIPD();
@@ -114,7 +118,7 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
LayoutContext childLC = LayoutContext.offspringOf(layoutContext); // TODO copyOf? newInstance?
childLC.setRefIPD(layoutContext.getRefIPD());
@SuppressWarnings("unchecked")
- List<ListElement> childElements = childLM.getNextKnuthElements(childLC, alignmentBaseline);
+ List<ListElement> childElements = childLM.getNextKnuthElements(childLC, alignment);
allChildElements.addAll(childElements);
// TODO breaks, keeps, empty content
}
@@ -127,7 +131,7 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
}
private void determineBPD() {
- LengthRangeProperty bpd = ((InlineContainer) fobj).getBlockProgressionDimension();
+ LengthRangeProperty bpd = getInlineContainer().getBlockProgressionDimension();
Property optimum = bpd.getOptimum(this);
int actualBPD = ElementListUtils.calcContentLength(childElements);
if (optimum.isAuto()) {
@@ -181,15 +185,15 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
}
private boolean canRecoverFromOverflow() {
- return ((InlineContainer) fobj).getOverflow() != EN_ERROR_IF_OVERFLOW;
+ return getInlineContainer().getOverflow() != EN_ERROR_IF_OVERFLOW;
}
private int getAlignmentPoint() {
- Length alignmentAdjust = ((InlineContainer) fobj).getAlignmentAdjust();
+ Length alignmentAdjust = getInlineContainer().getAlignmentAdjust();
int baseline = alignmentAdjust.getEnum();
if (baseline == Constants.EN_AUTO
|| baseline == Constants.EN_BASELINE) {
- return getInlineContainerBaselineOffset(alignmentBaseline);
+ return getInlineContainerBaselineOffset(getInlineContainer().getAlignmentBaseline());
} else if (baseline != 0) {
return getInlineContainerBaselineOffset(baseline);
} else {
@@ -294,7 +298,7 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
}
private boolean needClip() {
- int overflow = ((InlineContainer) fobj).getOverflow();
+ int overflow = getInlineContainer().getOverflow();
return (overflow == EN_HIDDEN || overflow == EN_ERROR_IF_OVERFLOW);
}