aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/fo
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-07-18 09:43:20 +0000
committerKeiron Liddle <keiron@apache.org>2002-07-18 09:43:20 +0000
commit529a3492c58d2acb6ea3aa8b12beb51ab90b1aa6 (patch)
tree9cb8d2e5600f2f057e37006bb81d7bdaebeb51c5 /src/org/apache/fop/fo
parent377e152a0e3d506d717d36dee9c6eea92cfaeaf9 (diff)
downloadxmlgraphics-fop-529a3492c58d2acb6ea3aa8b12beb51ab90b1aa6.tar.gz
xmlgraphics-fop-529a3492c58d2acb6ea3aa8b12beb51ab90b1aa6.zip
start page sequence with title
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195004 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo')
-rw-r--r--src/org/apache/fop/fo/Title.java9
-rw-r--r--src/org/apache/fop/fo/pagination/PageSequence.java22
2 files changed, 25 insertions, 6 deletions
diff --git a/src/org/apache/fop/fo/Title.java b/src/org/apache/fop/fo/Title.java
index f099fa29f..ccbcaac83 100644
--- a/src/org/apache/fop/fo/Title.java
+++ b/src/org/apache/fop/fo/Title.java
@@ -23,6 +23,14 @@ public class Title extends ToBeImplementedElement {
super(parent);
}
+ public org.apache.fop.area.Title getTitleArea() {
+ org.apache.fop.area.Title title =
+ new org.apache.fop.area.Title();
+ // use special layout manager to add the inline areas
+ // to the Title.
+ return title;
+ }
+
public void setup() {
// Common Accessibility Properties
@@ -57,3 +65,4 @@ public class Title extends ToBeImplementedElement {
}
}
+
diff --git a/src/org/apache/fop/fo/pagination/PageSequence.java b/src/org/apache/fop/fo/pagination/PageSequence.java
index 2ff146c3a..e9c36a1f4 100644
--- a/src/org/apache/fop/fo/pagination/PageSequence.java
+++ b/src/org/apache/fop/fo/pagination/PageSequence.java
@@ -77,6 +77,9 @@ public class PageSequence extends FObj {
// fo:flow per fo:page-sequence only.
private boolean isFlowSet = false;
+ // for structure handler
+ private boolean sequenceStarted = false;
+
//
// state attributes used during layout
//
@@ -128,7 +131,7 @@ public class PageSequence extends FObj {
/**
* The fo:title object for this page-sequence.
*/
- private FObj titleFO;
+ private Title titleFO;
public PageSequence(FONode parent) {
@@ -194,8 +197,6 @@ public class PageSequence extends FObj {
// this.properties.get("country");
// this.properties.get("language");
setupID();
-
- structHandler.startPageSequence(this, layoutMasterSet);
}
@@ -232,8 +233,11 @@ public class PageSequence extends FObj {
if (childName.equals("fo:title")) {
if (this._flowMap.size()>0) {
log.warn("fo:title should be first in page-sequence");
+ } else {
+ this.titleFO = (Title)child;
+ structHandler.startPageSequence(this, titleFO, layoutMasterSet);
+ sequenceStarted = true;
}
- this.titleFO = (FObj)child;
}
else if (childName.equals("fo:flow")) {
if (this.mainFlow != null) {
@@ -241,6 +245,10 @@ public class PageSequence extends FObj {
+ " per fo:page-sequence");
}
else {
+ if(!sequenceStarted) {
+ structHandler.startPageSequence(this, titleFO, layoutMasterSet);
+ sequenceStarted = true;
+ }
this.mainFlow = (Flow)child;
addFlow(mainFlow);
super.addChild(child); // For getChildren
@@ -252,6 +260,10 @@ public class PageSequence extends FObj {
" must precede fo:flow; ignoring");
}
else {
+ if(!sequenceStarted) {
+ structHandler.startPageSequence(this, titleFO, layoutMasterSet);
+ sequenceStarted = true;
+ }
addFlow((Flow)child);
}
}
@@ -310,8 +322,6 @@ public class PageSequence extends FObj {
// If no main flow, nothing to layout!
if (this.mainFlow == null) return;
- areaTree.startPageSequence(null);
-
// Initialize if already used?
this.layoutMasterSet.resetPageMasters();