[FOray-commit] SF.net SVN: foray: [9662] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-05-30 15:06:56
|
Revision: 9662
http://svn.sourceforge.net/foray/?rev=9662&view=rev
Author: victormote
Date: 2007-05-30 08:06:57 -0700 (Wed, 30 May 2007)
Log Message:
-----------
Fix bug in computation of the optimum table width.
Modified Paths:
--------------
trunk/foray/doc/web/app/using/release.html
trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java
Modified: trunk/foray/doc/web/app/using/release.html
===================================================================
--- trunk/foray/doc/web/app/using/release.html 2007-05-30 01:34:35 UTC (rev 9661)
+++ trunk/foray/doc/web/app/using/release.html 2007-05-30 15:06:57 UTC (rev 9662)
@@ -45,11 +45,12 @@
<li>Added support for the axsl:metadata extension. See
<a href="/app/features/extensions.html#axsl-extensions">aXSL
Extensions</a>.</li>
- <li>Added parse-time support for the objects and properties added in XSL-FO
- 1.1.
- These are not necessarily validated or used, but their existence should not
- cause processing errors.
+ <li>Added parsing and validation support for the objects and properties added
+ in XSL-FO 1.1.
+ These are not necessarily used by other FOray modules, but their existence
+ should not cause processing errors.
(The bookmark-related objects are fully supported).</li>
+ <li>Significant improvements to expressions in property values.</li>
</ul>
<h3>Unreleased changes of interest to Developers</h3>
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2007-05-30 01:34:35 UTC (rev 9661)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2007-05-30 15:06:57 UTC (rev 9662)
@@ -277,31 +277,26 @@
* @return The new width of the table.
*/
private int calcFixedColumnWidths(final int maxAllocationIPD) {
- final Table node = this.traitGeneratedBy();
- final int tableWidth = node.traitIPDimensionOpt(this);
+ final Table table = this.traitGeneratedBy();
+ final int tableWidth = table.traitIPDimensionOpt(this);
/* Accumulates the total table units used in columns in this table. */
double totalTableUnits = 0.0;
- /*
- * Accumulates the total width, in millipoints(?), of the columns that
- * have a fixed width.
- */
+ /* Accumulates the total width, in millipoints, of the columns that
+ * have a fixed width. */
int totalFixedWidth = 0;
/* Minimum number of proportional units. */
double tuMin = Double.MAX_VALUE;
- /*
- * Loop through the columns and total the fixed widths and proportional
- * units for each one.
- */
- for (int i = 0; i < node.getTableColumns().length; i++) {
- final TableColumn column = node.getTableColumns()[i];
+ /* Loop through the columns and total the fixed widths and proportional
+ * units for each one. */
+ for (int i = 0; i < table.getTableColumns().length; i++) {
+ final TableColumn column = table.getTableColumns()[i];
if (column == null) {
getLogger().warn("No table-column specification for column " +
(i + 1) + ".");
} else {
final double tu = column.traitColumnWidthTableUnits();
- /* Keep track of minimum number of proportional units
- * in any column which has only proportional units.
- */
+ /* Keep track of minimum number of proportional units in any
+ * column which has only proportional units. */
if (tu > 0 && tu < tuMin
&& column.traitColumnWidth(this,
tableWidth) == 0) {
@@ -320,33 +315,32 @@
int maxIPD;
final boolean bHasProportionalUnits = totalTableUnits > 0.0;
- if (node.traitIPDimensionMax(this) >= 0) {
- maxIPD = node.traitIPDimensionMax(this);
+ if (table.traitIPDimensionMax(this) >= 0) {
+ maxIPD = table.traitIPDimensionMax(this);
} else {
maxIPD = maxAllocationIPD;
}
- if (node.traitIPDimensionOpt(this) < 0) {
+ if (table.traitIPDimensionOpt(this) < 0) {
optIPD = -1;
} else {
- /* TODO: This looks like a bug. Should be getIPDOptimum()? */
- optIPD = node.traitIPDimensionMax(this);
+ optIPD = table.traitIPDimensionOpt(this);
}
- if (node.traitIPDimensionMin(this) < 0) {
+ if (table.traitIPDimensionMin(this) < 0) {
minIPD = -1;
} else {
- minIPD = node.traitIPDimensionMin(this);
+ minIPD = table.traitIPDimensionMin(this);
}
if (bHasProportionalUnits && optIPD < 0) {
if (minIPD > 0) {
- if (node.traitIPDimensionMax(this) >= 0) {
+ if (table.traitIPDimensionMax(this) >= 0) {
optIPD = (minIPD + maxIPD) / 2;
} else {
optIPD = minIPD;
}
- } else if (node.traitIPDimensionMax(this) >= 0) {
+ } else if (table.traitIPDimensionMax(this) >= 0) {
optIPD = maxIPD;
} else {
getLogger().error("At least one of minimum, optimum, or "
@@ -399,8 +393,8 @@
}
// Now distribute the extra units onto each column and set offsets
int columnOffset = 0;
- for (int i = 0; i < node.getTableColumns().length; i++) {
- final TableColumn column = node.getTableColumns()[i];
+ for (int i = 0; i < table.getTableColumns().length; i++) {
+ final TableColumn column = table.getTableColumns()[i];
if (column != null) {
//Compute the width of the column
int colWidth = -1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|