You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2013/11/07 13:32:21 UTC
svn commit: r1539614 - in /xmlgraphics/fop/branches/Temp_InlineContainer:
src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml
Author: vhennebert
Date: Thu Nov 7 12:32:20 2013
New Revision: 1539614
URL: http://svn.apache.org/r1539614
Log:
Added support for <length> values on alignment-adjust
Modified:
xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml
Modified: xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java?rev=1539614&r1=1539613&r2=1539614&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java Thu Nov 7 12:32:20 2013
@@ -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 InlineContainerLayoutManage
} 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;
}
}
Modified: xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml?rev=1539614&r1=1539613&r2=1539614&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml (original)
+++ xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml Thu Nov 7 12:32:20 2013
@@ -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>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org