From 66526aece168d5a0e2b5c45ca7e9e1dcce63e83d Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Wed, 11 Oct 2006 14:40:34 +0000 Subject: [PATCH] Fixed possible endless loop. 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 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java b/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java index 3ca5f935f..d7200dc24 100644 --- a/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java +++ b/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java @@ -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); } -- 2.39.5