From 30ec08efcaf78542882357c370b5d98811a4b0b6 Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Sat, 17 Jan 2004 06:31:26 +0000 Subject: [PATCH] Added numMarkers and int getMarkers. Added MC_LEADER to set of states for stateFlags. Removed unused debugging methods. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197206 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/FONode.java | 47 +++++++++++++++----------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/src/java/org/apache/fop/fo/FONode.java b/src/java/org/apache/fop/fo/FONode.java index 19d710bbd..320295ffa 100644 --- a/src/java/org/apache/fop/fo/FONode.java +++ b/src/java/org/apache/fop/fo/FONode.java @@ -71,8 +71,10 @@ import org.apache.fop.datatypes.indirect.IndirectValue; import org.apache.fop.fo.expr.FunctionNotImplementedException; import org.apache.fop.fo.expr.PropertyException; import org.apache.fop.fo.expr.PropertyParser; +import org.apache.fop.fo.flow.FoMarker; import org.apache.fop.fo.properties.Property; import org.apache.fop.messaging.MessageHandler; +import org.apache.fop.xml.FoXmlEvent; import org.apache.fop.xml.XmlEvent; import org.apache.fop.xml.SyncedXmlEventsBuffer; import org.apache.fop.xml.Namespaces; @@ -115,6 +117,7 @@ public class FONode extends Node{ ,MC_FOOTNOTE = 1024 ,MC_MULTI_CASE = 2048 ,MC_ABSOLUTELY_POSITIONED = 4096 + ,MC_LEADER = 8192 ; public static final int @@ -207,6 +210,9 @@ public class FONode extends Node{ /** Ancestor reference area of this FONode. */ protected FONode ancestorRefArea = null; + /** The number of markers on this FO. */ + protected int numMarkers = 0; + /** * @param foTree an FOTree to which this node belongs * @param type the fo type of this FONode. @@ -346,26 +352,6 @@ public class FONode extends Node{ foAttributes = null; } - /** - * Get the sparsePropsSet for this node. - * @return the PropertyValue[]. - */ - /* DEBUG - public PropertyValue[] getSparsePropsSet() { - return sparsePropsSet; - } - */ - - /** - * Get the sparsePropsMap for this node. - * @return the int[]. - */ - /* DEBUG - public int[] getSparsePropsMap() { - return sparsePropsMap; - } - */ - /** * Get the eclosing FOTree instance of this FONode. * @return the FOTree. @@ -620,4 +606,25 @@ public class FONode extends Node{ } } + public int getMarkers() throws FOPException { + XmlEvent ev; + + try { + while ((ev = xmlevents.expectStartElement + (FObjectNames.MARKER, XmlEvent.DISCARD_W_SPACE)) + != null) { + new FoMarker(getFOTree(), this, (FoXmlEvent)ev, stateFlags); + numMarkers++; + ev = xmlevents.getEndElement( + SyncedXmlEventsBuffer.DISCARD_EV, ev); + namespaces.surrenderEvent(ev); + } + } catch (TreeException e) { + throw new FOPException(e); + } catch (FOPException e) { + throw new FOPException(e); + } + return numMarkers; + } + }// FONode -- 2.39.5