From f4bb629ab722bbc4991cd4e5ceb37fb0a060b613 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Thu, 7 Nov 2013 12:32:20 +0000 Subject: [PATCH] Added support for values on alignment-adjust git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_InlineContainer@1539614 13f79535-47bb-0310-9956-ffa450edef68 --- .../inline/InlineContainerLayoutManager.java | 7 ++++++- .../inline-container_alignment-adjust.xml | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) 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 @@ + + + alignment-adjust="30pt": + The line before. The line before. Before: + Inside the inline-container. + After the inline-container. + + + @@ -206,5 +216,12 @@ + + + + + + + -- 2.39.5