]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugzilla 47835: fixed handling of percentage values for provisional-distance-between...
authorVincent Hennebert <vhennebert@apache.org>
Tue, 13 Oct 2009 10:25:42 +0000 (10:25 +0000)
committerVincent Hennebert <vhennebert@apache.org>
Tue, 13 Oct 2009 10:25:42 +0000 (10:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@824668 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/FOPropertyMapping.java
status.xml
test/layoutengine/standard-testcases/list_provisional-distance-between-starts_percentage.xml [new file with mode: 0644]

index b4a864e438bd0dd71b2167ba974a1274ea1c611f..3946a3c1b40c006591f7bb8c1e58d8f0e45838bc 100644 (file)
@@ -2525,6 +2525,7 @@ public final class FOPropertyMapping implements Constants {
         m  = new LengthProperty.Maker(PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS);
         m.setInherited(true);
         m.setDefault("24pt");
+        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         addPropertyMaker("provisional-distance-between-starts", m);
 
         // ref-id
index e9256ffe2cf5930b8b0d00597949c73082b9070b..bfd2bc1ec16f3fc9fa0bd8d08fece61e63862a9a 100644 (file)
@@ -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" fixes-bug="47835" due-to="Jonathan Levinson">
+        Fixed handling of percentage values for provisional-distance-between-starts.
+      </action>
       <action context="Renderers" dev="CB" type="add">
         Added support for positioning Page Overlays in AFP Output
       </action>
diff --git a/test/layoutengine/standard-testcases/list_provisional-distance-between-starts_percentage.xml b/test/layoutengine/standard-testcases/list_provisional-distance-between-starts_percentage.xml
new file mode 100644 (file)
index 0000000..d184fac
--- /dev/null
@@ -0,0 +1,104 @@
+<?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-distance-between-starts works correctly when specified as a 
+      percentage.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+      <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="10%">
+            <fo:list-item>
+              <fo:list-item-label end-indent="label-end()">
+                <fo:block>•</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>•</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="10%">
+              <fo:list-item>
+                <fo:list-item-label end-indent="label-end()">
+                  <fo:block>•</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>•</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="24000"  xpath="//flow/block[1]/block[1]/block[1]/block[1]/@ipd"/>
+    <eval expected="276000" xpath="//flow/block[1]/block[1]/block[1]/block[1]/@end-indent"/>
+    <eval expected="270000" xpath="//flow/block[1]/block[1]/block[2]/block[1]/@ipd"/>
+    <eval expected="30000"  xpath="//flow/block[1]/block[1]/block[2]/block[1]/@start-indent"/>
+    <!-- List item 2 -->
+    <eval expected="24000"  xpath="//flow/block[1]/block[2]/block[1]/block[1]/@ipd"/>
+    <eval expected="276000" xpath="//flow/block[1]/block[2]/block[1]/block[1]/@end-indent"/>
+    <eval expected="270000" xpath="//flow/block[1]/block[2]/block[2]/block[1]/@ipd"/>
+    <eval expected="30000"  xpath="//flow/block[1]/block[2]/block[2]/block[1]/@start-indent"/>
+
+    <!-- List 2 -->
+    <!-- List item 1 -->
+    <eval expected="9000"   xpath="//flow/block[3]/block[1]/block[1]/block[1]/block[1]/block[1]/@ipd"/>
+    <eval expected="141000" xpath="//flow/block[3]/block[1]/block[1]/block[1]/block[1]/block[1]/@end-indent"/>
+    <eval expected="135000" xpath="//flow/block[3]/block[1]/block[1]/block[1]/block[2]/block[1]/@ipd"/>
+    <eval expected="15000"  xpath="//flow/block[3]/block[1]/block[1]/block[1]/block[2]/block[1]/@start-indent"/>
+    <!-- List item 2 -->
+    <eval expected="9000"   xpath="//flow/block[3]/block[1]/block[1]/block[2]/block[1]/block[1]/@ipd"/>
+    <eval expected="141000" xpath="//flow/block[3]/block[1]/block[1]/block[2]/block[1]/block[1]/@end-indent"/>
+    <eval expected="135000" xpath="//flow/block[3]/block[1]/block[1]/block[2]/block[2]/block[1]/@ipd"/>
+    <eval expected="15000"  xpath="//flow/block[3]/block[1]/block[1]/block[2]/block[2]/block[1]/@start-indent"/>
+  </checks>
+</testcase>