From: William Victor Mote Date: Tue, 6 May 2003 05:49:14 +0000 (+0000) Subject: Clean up StructureHandler's startPageSequence() method to remove unnecessary paramete... X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1480 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8385f717ac4f2fcf8bd6c659433ea8d142aa38ce;p=xmlgraphics-fop.git Clean up StructureHandler's startPageSequence() method to remove unnecessary parameters. Adjust concrete classes accordingly. Add accessor methods in PageSequence to provide this data. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196406 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/apps/LayoutHandler.java b/src/java/org/apache/fop/apps/LayoutHandler.java index 348d8112b..ddc9fa82a 100644 --- a/src/java/org/apache/fop/apps/LayoutHandler.java +++ b/src/java/org/apache/fop/apps/LayoutHandler.java @@ -248,15 +248,11 @@ public class LayoutHandler extends StructureHandler { * on the area tree with the page sequence title. * * @param pageSeq the page sequence starting - * @param seqTitle the title of the page sequence - * @param lms the layout master set */ - public void startPageSequence(PageSequence pageSeq, - org.apache.fop.fo.Title seqTitle, - LayoutMasterSet lms) { + public void startPageSequence(PageSequence pageSeq) { Title title = null; - if (seqTitle != null) { - title = seqTitle.getTitleArea(); + if (pageSeq.getTitleFO() != null) { + title = pageSeq.getTitleFO().getTitleArea(); } areaTree.startPageSequence(title); } diff --git a/src/java/org/apache/fop/apps/StructureHandler.java b/src/java/org/apache/fop/apps/StructureHandler.java index 1e22e9e20..77667937c 100644 --- a/src/java/org/apache/fop/apps/StructureHandler.java +++ b/src/java/org/apache/fop/apps/StructureHandler.java @@ -122,7 +122,7 @@ abstract public class StructureHandler extends AbstractLogEnabled { */ abstract public void endDocument() throws SAXException; - abstract public void startPageSequence(PageSequence pageSeq, Title seqTitle, LayoutMasterSet lms); + abstract public void startPageSequence(PageSequence pageSeq); abstract public void endPageSequence(PageSequence pageSeq) throws FOPException; diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index 767d5f896..5e9d2b1ad 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -340,7 +340,7 @@ public class PageSequence extends FObj { */ private void startStructuredPageSequence() { if (!sequenceStarted) { - structHandler.startPageSequence(this, titleFO, layoutMasterSet); + structHandler.startPageSequence(this); sequenceStarted = true; } } @@ -807,5 +807,14 @@ public class PageSequence extends FObj { public StaticContent getStaticContent(String name) { return (StaticContent)flowMap.get(name); } + + public LayoutMasterSet getLayoutMasterSet() { + return layoutMasterSet; + } + + public Title getTitleFO() { + return titleFO; + } + } diff --git a/src/java/org/apache/fop/mif/MIFHandler.java b/src/java/org/apache/fop/mif/MIFHandler.java index fd9b11a8c..2ef774edb 100644 --- a/src/java/org/apache/fop/mif/MIFHandler.java +++ b/src/java/org/apache/fop/mif/MIFHandler.java @@ -147,13 +147,13 @@ public class MIFHandler extends StructureHandler { * by the following flows and static areas. * @see org.apache.fop.apps.StructureHandler */ - public void startPageSequence(PageSequence pageSeq, Title seqTitle, LayoutMasterSet lms) { + public void startPageSequence(PageSequence pageSeq) { // get the layout master set // setup the pages for this sequence String name = pageSeq.getProperty("master-reference").getString(); - SimplePageMaster spm = lms.getSimplePageMaster(name); + SimplePageMaster spm = pageSeq.getLayoutMasterSet().getSimplePageMaster(name); if (spm == null) { - PageSequenceMaster psm = lms.getPageSequenceMaster(name); + PageSequenceMaster psm = pageSeq.getLayoutMasterSet().getPageSequenceMaster(name); } else { // create simple master with regions MIFElement prop = new MIFElement("PageType"); diff --git a/src/java/org/apache/fop/rtf/renderer/RTFHandler.java b/src/java/org/apache/fop/rtf/renderer/RTFHandler.java index 4a902624f..15e7240cb 100644 --- a/src/java/org/apache/fop/rtf/renderer/RTFHandler.java +++ b/src/java/org/apache/fop/rtf/renderer/RTFHandler.java @@ -150,7 +150,7 @@ public class RTFHandler extends StructureHandler { /** * @see org.apache.fop.apps.StructureHandler */ - public void startPageSequence(PageSequence pageSeq, Title seqTitle, LayoutMasterSet lms) { + public void startPageSequence(PageSequence pageSeq) { try { sect = docArea.newSection(); if (!warned) {