git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196390
13f79535-47bb-0310-9956-
ffa450edef68
* @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;
}