]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Refactor: unwind "for" statement in findNearestAncestorGeneratingRAs() for more flexi...
authorWilliam Victor Mote <vmote@apache.org>
Fri, 2 May 2003 15:56:15 +0000 (15:56 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Fri, 2 May 2003 15:56:15 +0000 (15:56 +0000)
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

index a357297749247f8a82e57a065b0ab45711692e77..c008b5ac90d24d78cb6066db786fe94e63dd701b 100644 (file)
@@ -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;
     }