You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by fo...@locus.apache.org on 2000/11/17 11:18:29 UTC
cvs commit: xml-fop/src/org/apache/fop/fo/pagination LayoutMasterSet.java PageSequence.java SimplePageMaster.java
fotis 00/11/17 02:18:28
Modified: src/org/apache/fop/fo/pagination LayoutMasterSet.java
PageSequence.java SimplePageMaster.java
Log:
adds a warning for regions in flows which don't exist in the layout
master set [Kelly Campbell]
Revision Changes Path
1.8 +16 -2 xml-fop/src/org/apache/fop/fo/pagination/LayoutMasterSet.java
Index: LayoutMasterSet.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/LayoutMasterSet.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- LayoutMasterSet.java 2000/11/15 10:26:23 1.7
+++ LayoutMasterSet.java 2000/11/17 10:18:28 1.8
@@ -1,4 +1,4 @@
-/*-- $Id: LayoutMasterSet.java,v 1.7 2000/11/15 10:26:23 fotis Exp $ --
+/*-- $Id: LayoutMasterSet.java,v 1.8 2000/11/17 10:18:28 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -164,7 +164,21 @@
}
}
-
+ /**
+ * 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;
+ }
}
1.21 +4 -1 xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java
Index: PageSequence.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- PageSequence.java 2000/11/15 10:26:23 1.20
+++ PageSequence.java 2000/11/17 10:18:28 1.21
@@ -1,4 +1,4 @@
-/*-- $Id: PageSequence.java,v 1.20 2000/11/15 10:26:23 fotis Exp $ --
+/*-- $Id: PageSequence.java,v 1.21 2000/11/17 10:18:28 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -209,6 +209,9 @@
{
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);
1.9 +13 -4 xml-fop/src/org/apache/fop/fo/pagination/SimplePageMaster.java
Index: SimplePageMaster.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/SimplePageMaster.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- SimplePageMaster.java 2000/11/15 10:26:23 1.8
+++ SimplePageMaster.java 2000/11/17 10:18:28 1.9
@@ -1,4 +1,4 @@
-/*-- $Id: SimplePageMaster.java,v 1.8 2000/11/15 10:26:23 fotis Exp $ --
+/*-- $Id: SimplePageMaster.java,v 1.9 2000/11/17 10:18:28 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -57,9 +57,8 @@
import org.apache.fop.layout.PageMaster;
import org.apache.fop.apps.FOPException;
-import java.util.Hashtable;
+import java.util.*;
-
public class SimplePageMaster extends FObj {
public static class Maker extends FObj.Maker {
@@ -171,6 +170,16 @@
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;
+
+ }
}