aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2013-11-07 12:32:20 +0000
committerVincent Hennebert <vhennebert@apache.org>2013-11-07 12:32:20 +0000
commitf4bb629ab722bbc4991cd4e5ceb37fb0a060b613 (patch)
tree5f7c8f83d4fb6899c63e1d622d489d9f3729a155
parentd08e7a0a304e7f3e3e0d5181bfc00959aa493eee (diff)
downloadxmlgraphics-fop-f4bb629ab722bbc4991cd4e5ceb37fb0a060b613.tar.gz
xmlgraphics-fop-f4bb629ab722bbc4991cd4e5ceb37fb0a060b613.zip
Added support for <length> values on alignment-adjust
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_InlineContainer@1539614 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java7
-rw-r--r--test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml17
2 files changed, 23 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
index 21e3cb283..539ebc897 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
@@ -28,6 +28,8 @@ import org.apache.fop.area.Trait;
import org.apache.fop.area.inline.Container;
import org.apache.fop.area.inline.InlineViewport;
import org.apache.fop.datatypes.Length;
+import org.apache.fop.datatypes.LengthBase;
+import org.apache.fop.datatypes.SimplePercentBaseContext;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.flow.InlineContainer;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -198,7 +200,10 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
} else if (baseline != 0) {
return getInlineContainerBaselineOffset(baseline);
} else {
- return 0;
+ int baselineOffset = getInlineContainerBaselineOffset(dominantBaseline);
+ int adjust = alignmentAdjust.getValue(
+ new SimplePercentBaseContext(null, LengthBase.ALIGNMENT_ADJUST, 0));
+ return baselineOffset + adjust;
}
}
diff --git a/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml b/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml
index 917a3a1d2..b63e36b69 100644
--- a/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml
+++ b/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml
@@ -131,6 +131,16 @@
</fo:flow>
</fo:page-sequence>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="30pt":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="30pt">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
</fo:root>
</fo>
@@ -206,5 +216,12 @@
<eval expected="28800" xpath="//pageSequence[10]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
<eval expected="0" xpath="//pageSequence[10]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+ <!-- 30pt -->
+ <eval expected="49764" xpath="//pageSequence[11]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="38664" xpath="//pageSequence[11]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[11]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[11]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[11]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
</checks>
</testcase>