[FOray-commit] SF.net SVN: foray: [10442] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2008-03-15 20:06:47
|
Revision: 10442
http://foray.svn.sourceforge.net/foray/?rev=10442&view=rev
Author: victormote
Date: 2008-03-15 13:06:48 -0700 (Sat, 15 Mar 2008)
Log Message:
-----------
Fix bug: not all descendants of LineArea were considered for word-spacing and other adjustments.
Modified Paths:
--------------
trunk/foray/doc/web/00-release/notes-unreleased.html
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
Modified: trunk/foray/doc/web/00-release/notes-unreleased.html
===================================================================
--- trunk/foray/doc/web/00-release/notes-unreleased.html 2008-03-15 19:12:31 UTC (rev 10441)
+++ trunk/foray/doc/web/00-release/notes-unreleased.html 2008-03-15 20:06:48 UTC (rev 10442)
@@ -32,6 +32,9 @@
ninth page as "1 (9 of 29)".</li>
<li>MathML documents are now supported inside fo:instream-foreign-object.
Previously they were supported only within fo:external-graphic.</li>
+ <li>Bugfix: Pioneer layout was not properly nesting inline elements in the AreaTree.</li>
+ <li>Bugfix: Not all descenants of a LineArea were considered for word-spacing and other spacing
+adjustments.</li>
</ul>
<h3>Unreleased changes of interest to Developers</h3>
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2008-03-15 19:12:31 UTC (rev 10441)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2008-03-15 20:06:48 UTC (rev 10442)
@@ -327,10 +327,11 @@
if (wordSpacingCapacity == 0) {
return;
}
- for (int i = 0; i < getChildren().size(); i++) {
- final Object object = getChildren().get(i);
- if (object instanceof TextArea) {
- final TextArea text = (TextArea) object;
+ final Iterator<OrderedTreeNode> iterator = this.postOrderDescendantIterator();
+ while (iterator.hasNext()) {
+ final OrderedTreeNode descendant = iterator.next();
+ if (descendant instanceof TextArea) {
+ final TextArea text = (TextArea) descendant;
boolean prorating = false;
if (Math.abs(wordSpacingCapacity) >= Math.abs(unusedSpace)) {
prorating = true;
@@ -351,10 +352,11 @@
*/
private int computeWordSpacingCapacity(final int unusedSpace) {
int wordSpacingCapacity = 0;
- for (int i = 0; i < getChildren().size(); i++) {
- final Object object = getChildren().get(i);
- if (object instanceof TextArea) {
- final TextArea text = (TextArea) object;
+ final Iterator<OrderedTreeNode> iterator = this.postOrderDescendantIterator();
+ while (iterator.hasNext()) {
+ final OrderedTreeNode descendant = iterator.next();
+ if (descendant instanceof TextArea) {
+ final TextArea text = (TextArea) descendant;
if (unusedSpace > 0) {
wordSpacingCapacity += text.maxWordSpacingCapacity()
- text.wordSpacingUsed();
@@ -413,10 +415,11 @@
if (letterSpacingCapacity == 0) {
return;
}
- for (int i = 0; i < getChildren().size(); i++) {
- final Object object = getChildren().get(i);
- if (object instanceof TextArea) {
- final TextArea text = (TextArea) object;
+ final Iterator<OrderedTreeNode> iterator = this.postOrderDescendantIterator();
+ while (iterator.hasNext()) {
+ final OrderedTreeNode descendant = iterator.next();
+ if (descendant instanceof TextArea) {
+ final TextArea text = (TextArea) descendant;
boolean prorating = false;
if (Math.abs(letterSpacingCapacity) >= Math.abs(unusedSpace)) {
prorating = true;
@@ -437,10 +440,11 @@
*/
private int computeLetterSpacingCapacity(final int unusedSpace) {
int letterSpacingCapacity = 0;
- for (int i = 0; i < getChildren().size(); i++) {
- final Object object = getChildren().get(i);
- if (object instanceof TextArea) {
- final TextArea text = (TextArea) object;
+ final Iterator<OrderedTreeNode> iterator = this.postOrderDescendantIterator();
+ while (iterator.hasNext()) {
+ final OrderedTreeNode descendant = iterator.next();
+ if (descendant instanceof TextArea) {
+ final TextArea text = (TextArea) descendant;
if (unusedSpace > 0) {
letterSpacingCapacity += text.maxLetterSpacingCapacity()
- text.letterSpacingUsed();
@@ -615,9 +619,9 @@
}
/* "... any lines in the block ending in U+000A." */
- final Area lastChild = this.getLastAreaChild();
- if (lastChild instanceof TextArea) {
- final TextArea textArea = (TextArea) lastChild;
+ final OrderedTreeNode lastLeaf = this.getLastLeaf();
+ if (lastLeaf instanceof TextArea) {
+ final TextArea textArea = (TextArea) lastLeaf;
if (textArea.endsWithLinefeed()) {
return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|