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 gm...@apache.org on 2004/06/09 00:16:52 UTC
cvs commit: xml-fop/src/java/org/apache/fop/fo/pagination LayoutMasterSet.java PageSequence.java
gmazza 2004/06/08 15:16:52
Modified: src/java/org/apache/fop/fo/pagination LayoutMasterSet.java
PageSequence.java
Log:
Better error-handling messages added for incorrect LayoutMasterSets.
Revision Changes Path
1.8 +4 -0 xml-fop/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
Index: LayoutMasterSet.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- LayoutMasterSet.java 22 May 2004 03:59:53 -0000 1.7
+++ LayoutMasterSet.java 8 Jun 2004 22:16:52 -0000 1.8
@@ -60,6 +60,10 @@
if (parent.getName().equals("fo:root")) {
Root root = (Root)parent;
+ if (root.getLayoutMasterSet() != null) {
+ throw new FOPException("Multiple fo:layout-master-sets " +
+ "found; only one allowed per document");
+ }
root.setLayoutMasterSet(this);
} else {
throw new FOPException("fo:layout-master-set must be child of fo:root, not "
1.22 +6 -2 xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java
Index: PageSequence.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- PageSequence.java 22 May 2004 03:59:53 -0000 1.21
+++ PageSequence.java 8 Jun 2004 22:16:52 -0000 1.22
@@ -138,12 +138,16 @@
this.root = (Root)parent;
// this.root.addPageSequence(this);
} else {
- throw new FOPException("page-sequence must be child of root, not "
+ throw new FOPException("Error: page-sequence must be child of root, not "
+ parent.getName());
}
layoutMasterSet = root.getLayoutMasterSet();
-
+
+ if (layoutMasterSet == null) {
+ throw new FOPException("Error: fo:layout-master-set undefined for this document");
+ }
+
// best time to run some checks on LayoutMasterSet
layoutMasterSet.checkRegionNames();
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org