aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Furini <lfurini@apache.org>2005-09-08 10:47:57 +0000
committerLuca Furini <lfurini@apache.org>2005-09-08 10:47:57 +0000
commit1c5cae7362ae33673b79090a2e2ae668babcb9da (patch)
tree1de36c56de9f2e5bb1f7f06fdcd96e2ed5c12795
parent87185a02acb55a5cf950f27cff44cab34e47bd7a (diff)
downloadxmlgraphics-fop-1c5cae7362ae33673b79090a2e2ae668babcb9da.tar.gz
xmlgraphics-fop-1c5cae7362ae33673b79090a2e2ae668babcb9da.zip
Removing trailing spaces at the end of text areas: this is done by storing the Position, whose value points to the AreaInfo created for a space, inside the glue element that is ignored if there is a line break.
This fixes item 2) in bug 36533. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@279551 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java8
-rw-r--r--test/layoutengine/testcases/wrapper_text-transform_1.xml5
2 files changed, 7 insertions, 6 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
index 7e709a93b..0e3667798 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
@@ -458,14 +458,14 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
wordSpaceIPD, false));
sequence.add
(new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
- new LeafPosition(this, vecAreaInfo.size() - 1), false));
+ new LeafPosition(this, -1), false));
sequence.add
(new KnuthPenalty(0, 0, false,
new LeafPosition(this, -1), true));
sequence.add
(new KnuthGlue(wordSpaceIPD.opt,
- 6 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
- new LeafPosition(this, -1), true));
+ new LeafPosition(this, vecAreaInfo.size() - 1), true));
sequence.add
(new KnuthInlineBox(0, 0, 0, 0,
new LeafPosition(this, -1), true));
@@ -486,14 +486,14 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
wordSpaceIPD, false));
sequence.add
(new KnuthGlue(0, 3 * wordSpaceIPD.opt, 0,
- new LeafPosition(this, vecAreaInfo.size() - 1), false));
+ new LeafPosition(this, -1), false));
sequence.add
(new KnuthPenalty(0, 0, false,
new LeafPosition(this, -1), true));
sequence.add
(new KnuthGlue(wordSpaceIPD.opt,
- 3 * wordSpaceIPD.opt, 0,
- new LeafPosition(this, -1), true));
+ new LeafPosition(this, vecAreaInfo.size() - 1), true));
iNextStart ++;
break;
diff --git a/test/layoutengine/testcases/wrapper_text-transform_1.xml b/test/layoutengine/testcases/wrapper_text-transform_1.xml
index 25133063d..827113678 100644
--- a/test/layoutengine/testcases/wrapper_text-transform_1.xml
+++ b/test/layoutengine/testcases/wrapper_text-transform_1.xml
@@ -41,7 +41,8 @@
<checks>
<eval expected="none: This tExT is left as-IS." xpath="//flow/block[1]"/>
<eval expected="capitalize: This TExT Is Capitalized." xpath="//flow/block[2]"/>
- <eval expected="uppercase: THIS TEXT IS CONVERTED TO UPPERCASE. LIBERTÉ, ÉGALITÉ, FRATERNITÉ UND KÄSE." xpath="//flow/block[3]"/>
- <eval expected="lowercase: this text is converted to lowercase. liberté, égalité, fraternité und käse." xpath="//flow/block[4]"/>
+ <!-- spaces are discarded when around a line break -->
+ <eval expected="uppercase: THIS TEXT IS CONVERTED TO UPPERCASE.LIBERTÉ, ÉGALITÉ, FRATERNITÉ UND KÄSE." xpath="//flow/block[3]"/>
+ <eval expected="lowercase: this text is converted to lowercase. liberté, égalité,fraternité und käse." xpath="//flow/block[4]"/>
</checks>
</testcase>