You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ad...@apache.org on 2006/06/02 17:12:56 UTC

svn commit: r411180 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java

Author: adelmelle
Date: Fri Jun  2 08:12:56 2006
New Revision: 411180

URL: http://svn.apache.org/viewvc?rev=411180&view=rev
Log:
Extends white-space removal to occur also before nested block-*level* FOs instead of only blocks.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java?rev=411180&r1=411179&r2=411180&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java Fri Jun  2 08:12:56 2006
@@ -44,7 +44,7 @@
     private int whiteSpaceCollapse;
     private FONode nextChild;
     private boolean endOfBlock;
-    private boolean nextChildIsBlock;
+    private boolean nextChildIsBlockLevel;
     private RecursiveCharIterator charIter;
     
     private List discardableFOCharacters;
@@ -101,14 +101,22 @@
                                 .getNameId() == Constants.FO_BLOCK));
         }
         endOfBlock = (nextChild == null && currentFO == currentBlock);
-        nextChildIsBlock = (nextChild != null 
-                        && nextChild.getNameId() == Constants.FO_BLOCK);
+        if (nextChild != null) {
+            int nextChildId = nextChild.getNameId();
+            nextChildIsBlockLevel = (nextChildId == Constants.FO_BLOCK
+                    || nextChildId == Constants.FO_TABLE_AND_CAPTION
+                    || nextChildId == Constants.FO_TABLE
+                    || nextChildId == Constants.FO_LIST_BLOCK
+                    || nextChildId == Constants.FO_BLOCK_CONTAINER);
+        } else {
+            nextChildIsBlockLevel = false;
+        }
         handleWhiteSpace();
         if (currentFO == currentBlock 
                 && pendingInlines != null 
                 && !pendingInlines.isEmpty()) {
             /* current FO is a block, and has pending inlines */
-            if (endOfBlock || nextChildIsBlock) {
+            if (endOfBlock || nextChildIsBlockLevel) {
                 if (nonWhiteSpaceCount == 0) {
                     /* handle white-space for all pending inlines*/
                     PendingInline p;
@@ -294,7 +302,7 @@
                 // No more characters == end of text run
                 // means EOL if there either is a nested block to be added,
                 // or if this is the last text node in the current block   
-                nextIsEOL = nextChildIsBlock || endOfBlock;
+                nextIsEOL = nextChildIsBlockLevel || endOfBlock;
             }
             return nextIsEOL;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org