From 2008636c7e152009d9eefdd68caf04a2906808b5 Mon Sep 17 00:00:00 2001 From: Luis Bernardo Date: Sat, 16 Mar 2013 00:01:28 +0000 Subject: FOP-2044: Hyphenation of Uppercase Words, Combined with Underlines; applied second patch by Robert Meyer; expanded the layout test case. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1457168 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/hyphenation/HyphenationTree.java | 3 ++- .../block_hyphenation_non_letter_words.xml | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/java/org/apache/fop/hyphenation/HyphenationTree.java b/src/java/org/apache/fop/hyphenation/HyphenationTree.java index 1709d204a..70fc3f05a 100644 --- a/src/java/org/apache/fop/hyphenation/HyphenationTree.java +++ b/src/java/org/apache/fop/hyphenation/HyphenationTree.java @@ -403,7 +403,8 @@ public class HyphenationTree extends TernaryTree for (int iNonLetterWord = 0; iNonLetterWord < nonLetterWords.size(); iNonLetterWord++) { char[] nonLetterWord = nonLetterWords.get(iNonLetterWord); Hyphenation curHyph = hyphenate(nonLetterWord, 0, nonLetterWord.length, - remainCharCount, pushCharCount); + (iNonLetterWord == 0) ? remainCharCount : 1, + (iNonLetterWord == nonLetterWords.size() - 1) ? pushCharCount : 1); if (curHyph == null) { continue; } diff --git a/test/layoutengine/hyphenation-testcases/block_hyphenation_non_letter_words.xml b/test/layoutengine/hyphenation-testcases/block_hyphenation_non_letter_words.xml index 94168850d..7609ffac5 100644 --- a/test/layoutengine/hyphenation-testcases/block_hyphenation_non_letter_words.xml +++ b/test/layoutengine/hyphenation-testcases/block_hyphenation_non_letter_words.xml @@ -41,14 +41,16 @@ >2. fill fill fill fill fill fill expected 3. fill fill fill fill fill fill _expected_ - 4. fill fill fill fill fill fill SUCCESS - 5. fill fill fill fill fill fill _SUCCESS_ - 6. fill fill fill fill OCF_SUCCESS - 6. fill fill fill TEST_CHICKEN_LONGISH_MULTIPLE_LINE_HYPHEN + 7. fill fill fill TEST_CHICKEN_LONGISH_MULTIPLE_LINE_HYPHEN + 8. fill fill fill EGOS_EGOS_EGOS_EGOS_EGOS @@ -57,5 +59,6 @@ + -- cgit v1.2.3