aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/layoutmgr/table
diff options
context:
space:
mode:
authorChris Bowditch <cbowditch@apache.org>2004-05-13 10:32:48 +0000
committerChris Bowditch <cbowditch@apache.org>2004-05-13 10:32:48 +0000
commit4640a463d858438163ce9c51c54b044983aa4864 (patch)
treed361f4d85bad82b78b0862d9af5b4baeeaf0190e /src/java/org/apache/fop/layoutmgr/table
parentf6064f69f4c9c001d9ab0db3d82f00e92a4359b0 (diff)
downloadxmlgraphics-fop-4640a463d858438163ce9c51c54b044983aa4864.tar.gz
xmlgraphics-fop-4640a463d858438163ce9c51c54b044983aa4864.zip
fixes problem that prevented proportional-column-width function working
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197592 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/table')
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
index 75a228514..7b6189c6e 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
@@ -1,12 +1,12 @@
/*
* Copyright 1999-2004 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-/* $Id$ */
+/* $Id: TableLayoutManager.java,v 1.8 2004/03/21 12:03:08 gmazza Exp $ */
package org.apache.fop.layoutmgr.table;
@@ -135,10 +135,12 @@ public class TableLayoutManager extends BlockStackingLayoutManager {
fobj.setLayoutDimension(PercentBase.BLOCK_BPD, context.getStackLimit().opt);
fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_IPD, context.getRefIPD());
fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_BPD, context.getStackLimit().opt);
-
+
+ // either works out table of column widths or if proportional-column-width function
+ // is used works out total factor, so that value of single unit can be computed.
int sumCols = 0;
float factors = 0;
- if (columns != null) {
+ if (columns != null) {
for (Iterator i = columns.iterator(); i.hasNext(); ) {
Column column = (Column) i.next();
Length width = column.getWidth();
@@ -148,8 +150,12 @@ public class TableLayoutManager extends BlockStackingLayoutManager {
}
}
}
+ // sets TABLE_UNITS in case where one or more columns is defined using proportional-column-width
if (sumCols < context.getRefIPD()) {
- fobj.setLayoutDimension(PercentBase.TABLE_UNITS, (context.getRefIPD() - sumCols) / factors);
+ if (fobj.getLayoutDimension(PercentBase.TABLE_UNITS).floatValue() == 0.0) {
+ fobj.setLayoutDimension(PercentBase.TABLE_UNITS,
+ (context.getRefIPD() - sumCols) / factors);
+ }
}
MinOptMax headerSize = null;
if (tableHeader != null) {