aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/fo/FObj.java10
1 files 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;
}