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 je...@apache.org on 2006/05/15 12:00:12 UTC

svn commit: r406596 - in /xmlgraphics/fop/trunk: ./ src/java/org/apache/fop/layoutmgr/table/ test/layoutengine/standard-testcases/

Author: jeremias
Date: Mon May 15 02:59:59 2006
New Revision: 406596

URL: http://svn.apache.org/viewcvs?rev=406596&view=rev
Log:
Bugfix: tables nested in inline elements caused a NullPointerException.
Furthermore, keep-together handling was not appropriate when a table is nested in an inline (fixes a ClassCastException).
Finally, TableContentPosition did not indicate that it generates area which made them be ignored by the InlineLM.

Added:
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_table_nested_1.xml   (with props)
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java?rev=406596&r1=406595&r2=406596&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java Mon May 15 02:59:59 2006
@@ -1127,6 +1127,11 @@
             }
         }
         
+        /** @see org.apache.fop.layoutmgr.Position#generatesAreas() */
+        public boolean generatesAreas() {
+            return true;
+        }
+
         /** @see java.lang.Object#toString() */
         public String toString() {
             StringBuffer sb = new StringBuffer("TableContentPosition:");

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java?rev=406596&r1=406595&r2=406596&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java Mon May 15 02:59:59 2006
@@ -61,7 +61,6 @@
 
     private Block curBlockArea;
 
-    private int referenceBPD;
     private double tableUnits;
     private boolean autoLayout = true;
 
@@ -156,7 +155,6 @@
             }
         }
 
-        referenceBPD = context.getStackLimit().opt;
         referenceIPD = context.getRefIPD();
 
         if (getTable().getInlineProgressionDimension().getOptimum(this).getEnum() != EN_AUTO) {
@@ -449,7 +447,7 @@
      */
     public boolean mustKeepTogether() {
         //TODO Keeps will have to be more sophisticated sooner or later
-        return ((BlockLevelLayoutManager)getParent()).mustKeepTogether() 
+        return super.mustKeepTogether() 
                 || !getTable().getKeepTogether().getWithinPage().isAuto()
                 || !getTable().getKeepTogether().getWithinColumn().isAuto();
     }
@@ -493,14 +491,6 @@
                 return super.getBaseLength(lengthBase, fobj);
             }
         }
-    }
-    
-    /**
-     * Returns the BPD of the content area
-     * @return the BPD of the content area
-     */
-    public int getContentAreaBPD() {
-        return referenceBPD;
     }
     
     /** @see org.apache.fop.layoutmgr.ConditionalElementListener */

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/status.xml?rev=406596&r1=406595&r2=406596&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Mon May 15 02:59:59 2006
@@ -27,6 +27,9 @@
 
   <changes>
     <release version="FOP Trunk">
+      <action context="Code" dev="JM" type="fix" fixes-bug="39443">
+        Bugfix: tables nested in inline elements caused a NullPointerException.
+      </action>
       <action context="Code" dev="JM" type="update">
         The default sRGB color profile provided by the Java class library is no longer
         embedded if it is encountered. This should reduce the PDF size considerably.

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_table_nested_1.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_table_nested_1.xml?rev=406596&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_table_nested_1.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_table_nested_1.xml Mon May 15 02:59:59 2006
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2006 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$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks fo:inline and nested fo:tables.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <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">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block>
+            <fo:inline>part1<fo:table width="100%" table-layout="fixed">
+                <fo:table-column column-width="65%"/>
+                <fo:table-column column-width="10%"/>
+                <fo:table-column column-width="25%"/>
+                <fo:table-body>
+                  <fo:table-row>
+                    <fo:table-cell>
+                      <fo:block>table content</fo:block>
+                    </fo:table-cell>
+                  </fo:table-row>
+                </fo:table-body>
+              </fo:table>part2</fo:inline>
+          </fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="3" xpath="count(//flow/block[1]/lineArea)"/>
+    <eval expected="table content" xpath="//flow/block[1]/lineArea[2]"/>
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_table_nested_1.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_table_nested_1.xml
------------------------------------------------------------------------------
    svn:keywords = Id



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