aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2009-10-13 10:39:49 +0000
committerVincent Hennebert <vhennebert@apache.org>2009-10-13 10:39:49 +0000
commit12270f3f4907da1b9381a5a319708a9f3c323f9f (patch)
tree6936ff6f0ef49f91f13bd6141302716d0c3b62b7
parentf5415501c73ee5c27e48834b5e51b74e27b99417 (diff)
downloadxmlgraphics-fop-12270f3f4907da1b9381a5a319708a9f3c323f9f.tar.gz
xmlgraphics-fop-12270f3f4907da1b9381a5a319708a9f3c323f9f.zip
Fixed handling of percentage values for provisional-label-separation
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@824682 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/fo/FOPropertyMapping.java1
-rw-r--r--status.xml3
-rw-r--r--test/layoutengine/standard-testcases/list_provisional-label-separation_percentage.xml106
3 files changed, 110 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java
index 3946a3c1b..de6ffca93 100644
--- a/src/java/org/apache/fop/fo/FOPropertyMapping.java
+++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java
@@ -2519,6 +2519,7 @@ public final class FOPropertyMapping implements Constants {
m = new LengthProperty.Maker(PR_PROVISIONAL_LABEL_SEPARATION);
m.setInherited(true);
m.setDefault("6pt");
+ m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
addPropertyMaker("provisional-label-separation", m);
// provisional-distance-between-starts
diff --git a/status.xml b/status.xml
index bfd2bc1ec..20297dae6 100644
--- a/status.xml
+++ b/status.xml
@@ -58,6 +58,9 @@
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
+ <action context="Layout" dev="VH" type="fix">
+ Fixed handling of percentage values for provisional-label-separation.
+ </action>
<action context="Layout" dev="VH" type="fix" fixes-bug="47835" due-to="Jonathan Levinson">
Fixed handling of percentage values for provisional-distance-between-starts.
</action>
diff --git a/test/layoutengine/standard-testcases/list_provisional-label-separation_percentage.xml b/test/layoutengine/standard-testcases/list_provisional-label-separation_percentage.xml
new file mode 100644
index 000000000..41a1d9413
--- /dev/null
+++ b/test/layoutengine/standard-testcases/list_provisional-label-separation_percentage.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that provisional-label-separation works correctly when specified as a
+ percentage.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page" page-width="320pt" page-height="220pt"
+ margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:list-block provisional-distance-between-starts="20%"
+ provisional-label-separation="10%">
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block background-color="yellow">•</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>list item 1</fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block background-color="yellow">•</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>list item 2</fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </fo:list-block>
+ <fo:block space-before="10pt">Inside a block-container:</fo:block>
+ <fo:block-container width="150pt" background-color="#F0F0F0">
+ <fo:list-block provisional-distance-between-starts="20%"
+ provisional-label-separation="10%">
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block background-color="yellow">•</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>list item 1</fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block background-color="yellow">•</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>list item 2</fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </fo:list-block>
+ </fo:block-container>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!-- List 1 -->
+ <!-- List item 1 -->
+ <eval expected="30000" xpath="//flow/block[1]/block[1]/block[1]/block[1]/@ipd"/>
+ <eval expected="270000" xpath="//flow/block[1]/block[1]/block[1]/block[1]/@end-indent"/>
+ <eval expected="240000" xpath="//flow/block[1]/block[1]/block[2]/block[1]/@ipd"/>
+ <eval expected="60000" xpath="//flow/block[1]/block[1]/block[2]/block[1]/@start-indent"/>
+ <!-- List item 2 -->
+ <eval expected="30000" xpath="//flow/block[1]/block[2]/block[1]/block[1]/@ipd"/>
+ <eval expected="270000" xpath="//flow/block[1]/block[2]/block[1]/block[1]/@end-indent"/>
+ <eval expected="240000" xpath="//flow/block[1]/block[2]/block[2]/block[1]/@ipd"/>
+ <eval expected="60000" xpath="//flow/block[1]/block[2]/block[2]/block[1]/@start-indent"/>
+
+ <!-- List 2 -->
+ <!-- List item 1 -->
+ <eval expected="15000" xpath="//flow/block[3]/block[1]/block[1]/block[1]/block[1]/block[1]/@ipd"/>
+ <eval expected="135000" xpath="//flow/block[3]/block[1]/block[1]/block[1]/block[1]/block[1]/@end-indent"/>
+ <eval expected="120000" xpath="//flow/block[3]/block[1]/block[1]/block[1]/block[2]/block[1]/@ipd"/>
+ <eval expected="30000" xpath="//flow/block[3]/block[1]/block[1]/block[1]/block[2]/block[1]/@start-indent"/>
+ <!-- List item 2 -->
+ <eval expected="15000" xpath="//flow/block[3]/block[1]/block[1]/block[2]/block[1]/block[1]/@ipd"/>
+ <eval expected="135000" xpath="//flow/block[3]/block[1]/block[1]/block[2]/block[1]/block[1]/@end-indent"/>
+ <eval expected="120000" xpath="//flow/block[3]/block[1]/block[1]/block[2]/block[2]/block[1]/@ipd"/>
+ <eval expected="30000" xpath="//flow/block[3]/block[1]/block[1]/block[2]/block[2]/block[1]/@start-indent"/>
+ </checks>
+</testcase>