Author: adelmelle
Date: Sun Jan  9 14:40:31 2011
New Revision: 1056945

URL: http://svn.apache.org/viewvc?rev=1056945&view=rev
Log:
Bugzilla 49848: Correct behavior of keep-together.within-line in case of nested 
inlines

Modified:
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
    xmlgraphics/fop/trunk/status.xml
    
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_keep-together.xml

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java?rev=1056945&r1=1056944&r2=1056945&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
 Sun Jan  9 14:40:31 2011
@@ -705,7 +705,7 @@ public class TextLayoutManager extends L
         if (inWord) {
             processWord(alignment, sequence, prevAreaInfo, ch, false, false);
         } else if (inWhitespace) {
-            processWhitespace(alignment, sequence, true);
+            processWhitespace(alignment, sequence, !keepTogether);
         } else if (areaInfo != null) {
             processLeftoverAreaInfo(alignment, sequence, areaInfo,
                     ch == CharUtilities.ZERO_WIDTH_SPACE);

Modified: xmlgraphics/fop/trunk/status.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=1056945&r1=1056944&r2=1056945&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Sun Jan  9 14:40:31 2011
@@ -58,6 +58,9 @@
       documents. Example: the fix of marks layering will be such a case when 
it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Layout" dev="AD" type="fix" fixes-bug="49848">
+        Bugfix: correct behavior of keep-together.within-line in case there 
are nested inlines
+      </action>
       <action context="Code" dev="AD" type="fix" fixes-bug="50471">
         Bugfix: avoid ArrayIndexOutOfBoundsException for codepoints without a 
linebreak class
       </action>

Modified: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_keep-together.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_keep-together.xml?rev=1056945&r1=1056944&r2=1056945&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_keep-together.xml
 (original)
+++ 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/inline_keep-together.xml
 Sun Jan  9 14:40:31 2011
@@ -38,6 +38,22 @@
             <fo:block keep-together.within-line="always">This is Blah blah 
blah blah!</fo:block>
             <fo:block>This is <fo:inline 
keep-together.within-line="always">Blah blah blah blah!</fo:inline></fo:block>
             <fo:block>This is <fo:wrapper 
keep-together.within-line="always">Blah blah blah blah!</fo:wrapper></fo:block>
+            <fo:block>
+              <fo:inline keep-together.within-line="always">
+                This<fo:inline> entire</fo:inline> sentence
+                <fo:inline>should be </fo:inline>kept 
+                <fo:inline>together
+                  <fo:inline>on
+                    <fo:inline>one
+                      <fo:inline>very,
+                        <fo:inline>very,</fo:inline>
+                        <fo:inline>very,</fo:inline>
+                        <fo:inline>very,</fo:inline>
+                        <fo:inline>long</fo:inline>
+                      </fo:inline></fo:inline></fo:inline>line
+                </fo:inline>
+              </fo:inline>
+            </fo:block>
           </fo:block-container>
         </fo:flow>
       </fo:page-sequence>
@@ -54,6 +70,9 @@
     <!-- The layout engine should warn the user about the overflow in this 
case. -->
     <eval expected="This is" 
xpath="//flow/block[1]/block[1]/block[3]/lineArea[1]"/>
     <eval expected="Blah blah blah blah!" 
xpath="//flow/block[1]/block[1]/block[3]/lineArea[2]"/>
+    
+    <!-- check effect of nested inlines (see Bugzilla #49848) -->
+    <eval expected="1" 
xpath="count(//flow/block[1]/block[1]/block[4]/lineArea)" />
 
   </checks>
 </testcase>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to