]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixed possible endless loop.
authorJeremias Maerki <jeremias@apache.org>
Wed, 11 Oct 2006 14:40:34 +0000 (14:40 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 11 Oct 2006 14:40:34 +0000 (14:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@462816 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java

index 3ca5f935f2cb17ff8d705b518afa52d4b7268a51..d7200dc24d317c43d18f1a6243332bb85140da6d 100644 (file)
@@ -120,9 +120,9 @@ public class XMLWhiteSpaceHandler {
             currentBlock = (Block) fo;
         } else if (foId == Constants.FO_RETRIEVE_MARKER) {
             /* look for the nearest block ancestor, if any */
-            FONode ancestor;
+            FONode ancestor = fo;
             do {
-                ancestor = fo.getParent();
+                ancestor = ancestor.getParent();
             } while (ancestor.getNameId() != Constants.FO_BLOCK
                     && ancestor.getNameId() != Constants.FO_STATIC_CONTENT);
             
@@ -188,9 +188,8 @@ public class XMLWhiteSpaceHandler {
                     /* handle white-space for all pending inlines*/
                     PendingInline p;
                     for (int i = pendingInlines.size(); --i >= 0;) {
-                        p = (PendingInline) pendingInlines.get(i);
-                        charIter = 
-                            (RecursiveCharIterator) p.firstTrailingWhiteSpace;
+                        p = (PendingInline)pendingInlines.get(i);
+                        charIter = (RecursiveCharIterator)p.firstTrailingWhiteSpace;
                         handleWhiteSpace();
                         pendingInlines.remove(p);
                     }