FOP-2960; fix + test

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1884753 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
index 8d9e972..4768607 100644
--- a/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
+++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
@@ -1018,12 +1018,20 @@
 
     /** {@inheritDoc} */
     public void hyphenate(Position pos, HyphContext hyphContext) {
-        GlyphMapping mapping = getGlyphMapping(((LeafPosition) pos).getLeafPos() + changeOffset);
+        int glyphIndex = ((LeafPosition) pos).getLeafPos() + changeOffset;
+        GlyphMapping mapping = getGlyphMapping(glyphIndex);
         int startIndex = mapping.startIndex;
         int stopIndex;
         boolean nothingChanged = true;
         Font font = mapping.font;
 
+        // skip hyphenation if previously hyphenated using soft hyphen
+        if (mapping.isHyphenated || (glyphIndex > 0 && getGlyphMapping(glyphIndex - 1).isHyphenated)) {
+            stopIndex = mapping.endIndex;
+            hyphContext.updateOffset(stopIndex - startIndex);
+            startIndex = stopIndex;
+        }
+
         while (startIndex < mapping.endIndex) {
             MinOptMax newIPD = MinOptMax.ZERO;
             boolean hyphenFollows;
@@ -1078,7 +1086,7 @@
                       new GlyphMapping(startIndex, stopIndex, 0,
                                      letterSpaceCount, newIPD, hyphenFollows,
                                      false, false, font, -1, null),
-                        ((LeafPosition) pos).getLeafPos() + changeOffset));
+                            glyphIndex));
                 nothingChanged = false;
             }
             startIndex = stopIndex;
diff --git a/fop/test/layoutengine/disabled-testcases.xml b/fop/test/layoutengine/disabled-testcases.xml
index b211b5b..8138492 100644
--- a/fop/test/layoutengine/disabled-testcases.xml
+++ b/fop/test/layoutengine/disabled-testcases.xml
@@ -87,13 +87,13 @@
   <testcase>
     <name>NPE for table inside an inline</name>
     <file>inline_block_nested_3.xml</file>
-    <description>Placing a table as a child of an fo:inline produces a 
+    <description>Placing a table as a child of an fo:inline produces a
     NullPointerException.</description>
   </testcase>
   <testcase>
     <name>Keeps on inline-container are not implemented, yet.</name>
     <file>inline-container_keeps.xml</file>
-    <description>The keep-with-previous and keep-with-next properties have not been implemented on 
+    <description>The keep-with-previous and keep-with-next properties have not been implemented on
       inline-container yet. They will be treated as if they had the value "auto".</description>
   </testcase>
   <testcase>
@@ -135,14 +135,14 @@
   <testcase>
     <name>Page breaking doesn't deal with IPD changes</name>
     <file>page-breaking_4.xml</file>
-    <description>Page breaking currently doesn't support changing available IPD 
+    <description>Page breaking currently doesn't support changing available IPD
     between pages of a single page-sequence. Element list generation has to be reset to
     redetermine line breaks in this case.</description>
   </testcase>
   <testcase>
     <name>Overflow handing is incomplete</name>
     <file>page-breaking_6.xml</file>
-    <description>Line breaking is not 100% correct when there's too little space. 
+    <description>Line breaking is not 100% correct when there's too little space.
     Overflows are not detected and warned.</description>
   </testcase>
   <testcase>
@@ -186,7 +186,7 @@
   <testcase>
     <name>table-cell empty area with marker.xml</name>
     <file>table-cell_empty_area_with_marker.xml</file>
-    <description>A table-cell producing an empty area does currently not add any markers to a page. 
+    <description>A table-cell producing an empty area does currently not add any markers to a page.
       See TODO entry in AreaAdditionUtil.</description>
   </testcase>
   <testcase>
@@ -197,12 +197,6 @@
     case should be revisited.</description>
   </testcase>
   <testcase>
-    <name>Soft hyphen with normal hyphenation enabled</name>
-    <file>block_shy_linebreaking_hyph.xml</file>
-    <description>A soft hyphen should be a preferred as break compared to a
-    normal hyphenation point but is not. Background info: see JIRA FOP-2466.</description>
-  </testcase>
-  <testcase>
     <name>Page-keep not respected in multi-column layout</name>
     <file>keep_within-page_multi-column_overflow.xml</file>
     <description>The block should cause overflow in the