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 ad...@apache.org on 2006/06/08 12:09:16 UTC

svn commit: r412714 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/fo/FOPropertyMapping.java status.xml test/fotree/testcases/table-border-separation2.fo

Author: adelmelle
Date: Thu Jun  8 03:09:15 2006
New Revision: 412714

URL: http://svn.apache.org/viewvc?rev=412714&view=rev
Log:
Bugfix: components of border-separation weren't set when using shorthand-mode, leading to an NPE being thrown (Bugzilla 39712)

Added:
    xmlgraphics/fop/trunk/test/fotree/testcases/table-border-separation2.fo   (with props)
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java?rev=412714&r1=412713&r2=412714&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java Thu Jun  8 03:09:15 2006
@@ -70,7 +70,7 @@
  *
  * @todo Check multi-threading safety of the statics below
  */
-public class FOPropertyMapping implements Constants {
+public final class FOPropertyMapping implements Constants {
     private static Map s_htPropNames = new HashMap();
     private static Map s_htSubPropNames = new HashMap();
     private static Map s_htPropIds = new HashMap();
@@ -247,7 +247,7 @@
      * @param name name of the subproperty.
      * @param id   Id for the subproperty from CP_* in Constants.java.
      */
-    public static void addSubpropMakerName(String name, int id) {
+    private static void addSubpropMakerName(String name, int id) {
         s_htSubPropNames.put(name, new Integer(id));
         s_htPropIds.put(new Integer(id), name);
     }
@@ -1291,7 +1291,6 @@
         PropertyMaker m;
         LengthProperty.Maker l;
         DimensionPropertyMaker pdim;
-        CorrespondingPropertyMaker corr;
 
         // block-progression-dimension
         m = new LengthRangeProperty.Maker(PR_BLOCK_PROGRESSION_DIMENSION);
@@ -2258,11 +2257,13 @@
 
         sub = new LengthProperty.Maker(CP_BLOCK_PROGRESSION_DIRECTION);
         sub.setDefault("0pt");
+        sub.setByShorthand(true);
         m.addSubpropMaker(sub);
 
         sub = new LengthProperty.Maker(CP_INLINE_PROGRESSION_DIRECTION);
         sub.setDefault("0pt");
         m.addSubpropMaker(sub);
+        sub.setByShorthand(true);
         addPropertyMaker("border-separation", m);
 
         // border-start-precedence
@@ -2497,8 +2498,10 @@
         m  = new ListProperty.Maker(PR_BACKGROUND_POSITION);
         m.setInherited(false);
         m.addKeyword("left", "0% 50%");
-        m.addKeyword("center", "50% 50%");
         m.addKeyword("right", "100% 50%");
+        m.addKeyword("center", "50% 50%");
+        m.addKeyword("top", "50% 0%");
+        m.addKeyword("bottom", "50% 100%");
         m.setDefault("0% 0%");
         m.setDatatypeParser(new BackgroundPositionShorthandParser());
         addPropertyMaker("background-position", m);

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=412714&r1=412713&r2=412714&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Thu Jun  8 03:09:15 2006
@@ -27,6 +27,10 @@
 
   <changes>
     <release version="FOP Trunk">
+      <action context="Code" dev="AD" type="fix" fixes-bug="39712">
+        Bugfix: components of the border-separation property weren't set when
+        in shorthand-mode, leading to a NPE being thrown.
+      </action>
       <action context="Code" dev="JM" type="fix">
         Bugfix: Table headers were omitted when a table is a child of a block-container.
       </action>

Added: xmlgraphics/fop/trunk/test/fotree/testcases/table-border-separation2.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/testcases/table-border-separation2.fo?rev=412714&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/fotree/testcases/table-border-separation2.fo (added)
+++ xmlgraphics/fop/trunk/test/fotree/testcases/table-border-separation2.fo Thu Jun  8 03:09:15 2006
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+
+  Licensed 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 $ -->
+<!-- This test checks whether the components of the border-separation property
+     are correctly set when using shorthand-mode -->
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
+         xmlns:test="http://xmlgraphics.apache.org/fop/test">
+  <fo:layout-master-set>
+    <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+      <fo:region-body/>
+    </fo:simple-page-master>
+  </fo:layout-master-set>
+  <fo:page-sequence master-reference="normal" white-space-collapse="true">
+    <fo:flow flow-name="xsl-region-body">
+      <fo:table table-layout="fixed" border-collapse="separate"
+                border-separation="0.04167in">
+        <test:assert property="border-separation.block-progression-direction"
+                     expected="3000mpt" />
+        <test:assert property="border-separation.inline-progression-direction"
+                     expected="3000mpt" />
+        <fo:table-column column-width="160pt"/>
+        <fo:table-column column-width="200pt"/>
+        <fo:table-body>
+          <fo:table-row>
+            <fo:table-cell background-color="yellow" border="solid 5pt">
+              <fo:block/>
+            </fo:table-cell>
+            <fo:table-cell border="solid 5pt">
+              <fo:block>cell2</fo:block>
+            </fo:table-cell>
+          </fo:table-row>
+          <fo:table-row empty-cells="show">
+            <fo:table-cell background-color="yellow" border="solid 5pt">
+              <fo:block/>
+            </fo:table-cell>
+            <fo:table-cell border="solid 5pt">
+              <fo:block>cell4</fo:block>
+            </fo:table-cell>
+          </fo:table-row>
+          <fo:table-row empty-cells="hide">
+            <fo:table-cell background-color="yellow" border="solid 5pt">
+              <fo:block/>
+            </fo:table-cell>
+            <fo:table-cell border="solid 5pt">
+              <fo:block>cell6</fo:block>
+            </fo:table-cell>
+          </fo:table-row>
+        </fo:table-body>
+      </fo:table>
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>
+

Propchange: xmlgraphics/fop/trunk/test/fotree/testcases/table-border-separation2.fo
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/fotree/testcases/table-border-separation2.fo
------------------------------------------------------------------------------
    svn:keywords = Id



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org