keiron 01/06/22 01:52:08
Modified:src/org/apache/fop/fo/pagination PageSequence.java Root.java
Log:
should handle page number properly, with threads
and multiple page sequences
also cleaned up code
Submitted by: Jeremias Maerki [EMAIL PROTECTED]
Revision ChangesPath
1.29 +353 -386 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.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- PageSequence.java 2001/05/01 01:00:32 1.28
+++ PageSequence.java 2001/06/22 08:52:08 1.29
@@ -1,8 +1,7 @@
-/*-- $Id: PageSequence.java,v 1.28 2001/05/01 01:00:32 arved Exp $ --
- *
+/*-- $Id: PageSequence.java,v 1.29 2001/06/22 08:52:08 keiron Exp $ --
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
*/
package org.apache.fop.fo.pagination;
@@ -19,7 +18,7 @@
import org.apache.fop.layout.AreaTree;
import org.apache.fop.layout.Page;
import org.apache.fop.layout.PageMaster;
-import org.apache.fop.apps.FOPException;
+import org.apache.fop.apps.FOPException;
// Java
import java.util.*;
@@ -29,15 +28,13 @@
* This provides pagination of flows onto pages. Much of the logic for paginating
* flows is contained in this class. The main entry point is the format method.
*/
-public class PageSequence extends FObj
-{
+public class PageSequence extends FObj {
//
// Factory methods
//
-public static class Maker extends FObj.Maker
-{
-public FObj make(FObj parent, PropertyList propertyList)
-throws FOPException {
+public static class Maker extends FObj.Maker {
+public FObj make(FObj parent,
+ PropertyList propertyList) throws FOPException {
return new PageSequence(parent, propertyList);
}
}
@@ -74,11 +71,11 @@
/** the master-name attribute */
private String masterName;
- // according to communication from Paul Grosso (XSL-List,
- // 001228, Number 406), confusion in spec section 6.4.5 about
- // multiplicity of fo:flow in XSL 1.0 is cleared up - one (1)
- // fo:flow per fo:page-sequence only.
- private boolean isFlowSet = false;
+// according to communication from Paul Grosso (XSL-List,
+// 001228, Number 406), confusion in spec section 6.4.5 about
+// multiplicity of fo:flow in XSL 1.0 is cleared up - one (1)
+// fo:flow per fo:page-sequence only.
+private boolean isFlowSet = false;
//
// state attributes used during layout
@@ -88,9 +85,6 @@
private int currentPageNumber = 0;
-/** keeps count of page number from previous PageSequence */
-private int runningPageNumberCounter = 0;
-
/** specifies page numbering type (auto|auto-even|auto-odd|explicit) */
private int pageNumberType;
@@ -107,78 +101,65 @@
private String currentPageMasterName;
-protected PageSequence(FObj parent, PropertyList propertyList)
-throws FOPException {
+protected PageSequence(FObj parent,
+ PropertyList propertyList) throws FOPException {
super(parent, propertyList);
this.name = fo:page-sequence;
-if ( parent.getName().equals(fo:root) )
-{
-this.runningPageNumberCounter=0; //else not initialized correctly
+if (parent.getName().equals(fo:root)) {
this.root = (Root) parent;
this.root.addPageSequence(this);
-}
-else
-{
-throw
-new FOPException(page-sequence must be child of root, not
-+ parent.getName());
+} else {
+throw new FOPException(
+ page-sequence must be child of root, not +
+ parent.getName());
}
-
+
layoutMasterSet = root.getLayoutMasterSet();
- // best time to run some checks on LayoutMasterSet
+// best time to run some checks on LayoutMasterSet
layoutMasterSet.checkRegionNames();
-
- _flowMap = new Hashtable();
-thisIsFirstPage=true; // we are now on the first page of the page sequence
-String ipnValue= this.properties.get(initial-page-number).getString();
+_flowMap = new Hashtable();
-if ( ipnValue.equals(auto) )
-{
-pageNumberType=AUTO;
-}
-