pbwest 2004/01/16 22:34:47 Modified: src/java/org/apache/fop/fo/flow Tag: FOP_0-20-0_Alt-Design FoLeader.java Log: Incluide test for nested fo:leader. Call getMarkers in superclass. Revision Changes Path No revision No revision 1.1.2.6 +15 -9 xml-fop/src/java/org/apache/fop/fo/flow/Attic/FoLeader.java Index: FoLeader.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Attic/FoLeader.java,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- FoLeader.java 15 Jan 2004 03:10:57 -0000 1.1.2.5 +++ FoLeader.java 17 Jan 2004 06:34:47 -0000 1.1.2.6 @@ -1,6 +1,4 @@ /* - * $Id$ - * * ============================================================================ * The Apache Software License, Version 1.1 * ============================================================================ @@ -47,17 +45,16 @@ * on behalf of the Apache Software Foundation and was originally created by * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache * Software Foundation, please see <http://www.apache.org/>. - * - * - * @author <a href="mailto:[EMAIL PROTECTED]">Peter B. West</a> + * + * $Id$ */ package org.apache.fop.fo.flow; -// FOP import java.util.Arrays; import java.util.BitSet; +// FOP import org.apache.fop.apps.FOPException; import org.apache.fop.datastructs.TreeException; import org.apache.fop.fo.FONode; @@ -74,6 +71,7 @@ /** * Implements the fo:leader flow object. + * @author <a href="mailto:[EMAIL PROTECTED]">Peter B. West</a> */ public class FoLeader extends FONode { @@ -162,6 +160,15 @@ super(foTree, FObjectNames.LEADER, parent, event, stateFlags, sparsePropsMap, sparseIndices); XmlEvent ev = null; + if ((stateFlags & FONode.MC_LEADER) != 0) { + // fo:leader cannot be nested + throw new FOPException( + "fo:leader found as descendent of fo:leader"); + } + if (getMarkers() != 0) { + throw new FOPException( + "fo:marker illegal as child of fo:leader"); + } do { try { if ((stateFlags & FONode.MC_OUT_OF_LINE) == 0) @@ -170,9 +177,8 @@ ev = xmlevents.expectOutOfLinePcdataOrInline(); if (ev != null) { // Generate the flow object - //System.out.println("Generating flow object for " + ev); FObjects.fobjects.makeFlowObject( - foTree, this, ev, stateFlags); + foTree, this, ev, stateFlags | FONode.MC_LEADER); if (ev.getType() != XmlEvent.CHARACTERS) { ev = xmlevents.getEndElement( SyncedXmlEventsBuffer.DISCARD_EV, ev);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]