}
}
-
+ /**
+ * Checks whether or not a region name exists in this master set
+ * @returns true when the region name specified has a region in this LayoutMasterSet
+ */
+ protected boolean regionNameExists(String regionName)
+ {
+ boolean result = false;
+ for (Enumeration e = simplePageMasters.elements(); e.hasMoreElements() ;) {
+ result = ((SimplePageMaster)e.nextElement()).regionNameExists(regionName);
+ if (result) {
+ return result;
+ }
+ }
+ return result;
+ }
}
if (_flowMap.containsKey(flow.getFlowName())) {
throw new FOPException("flow-names must be unique within an fo:page-sequence");
}
+ if (!this.layoutMasterSet.regionNameExists(flow.getFlowName())) {
+ MessageHandler.errorln("WARNING: region-name '"+flow.getFlowName()+"' doesn't exist in the layout-master-set.");
+ }
_flowMap.put(flow.getFlowName(), flow);
}
import org.apache.fop.layout.PageMaster;
import org.apache.fop.apps.FOPException;
-import java.util.Hashtable;
-
+import java.util.*;
public class SimplePageMaster extends FObj {
return _regions;
}
-
+ protected boolean regionNameExists(String regionName)
+ {
+ for (Enumeration regenum = _regions.elements(); regenum.hasMoreElements() ;) {
+ Region r = (Region)regenum.nextElement();
+ if (r.getRegionName().equals(regionName)) {
+ return true;
+ }
+ }
+ return false;
+
+ }
}