From f38f1324a9af2a9faad3b3a810ddbe2a937d5769 Mon Sep 17 00:00:00 2001 From: William Victor Mote Date: Fri, 2 May 2003 15:56:15 +0000 Subject: [PATCH] Refactor: unwind "for" statement in findNearestAncestorGeneratingRAs() for more flexibility. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196390 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/FObj.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index a35729774..c008b5ac9 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -180,11 +180,11 @@ public class FObj extends FONode { * @return FObj of the nearest ancestor that generates Reference Areas */ private FObj findNearestAncestorGeneratingRAs() { - FObj p; - FONode parent; - for (p = this; !p.generatesReferenceAreas() - && (parent = p.getParent()) != null - && (parent instanceof FObj); p = (FObj) parent) { + FObj p = this; + FObj parent = p.findNearestAncestorFObj(); + while (parent != null && !p.generatesReferenceAreas()) { + p = (FObj) parent; + parent = p.findNearestAncestorFObj(); } return p; } -- 2.39.5