From 69b7925f5cdbd813a4136705ee7a19e9af6f28fc Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Sat, 7 Jul 2007 01:07:10 +0000 Subject: Bugzilla 41656: Refactoring in the fo package: -> removal of the childNodes instance member in fop.fo.FObj -> addition of a firstChild instance member in fop.fo.FObj -> addition of a siblings instance member in fop.fo.FONode -> addition of a FONodeIterator interface in FONode + corresponding implementation in FObj -> changed implementations of FObj.addChildNode(), .removeChild() and .getChildNodes() git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@554104 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/pagination/Declarations.java | 10 +++++----- src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java | 2 +- src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java | 2 +- .../fop/fo/pagination/RepeatablePageMasterAlternatives.java | 2 +- src/java/org/apache/fop/fo/pagination/StaticContent.java | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/fo/pagination/Declarations.java b/src/java/org/apache/fop/fo/pagination/Declarations.java index 86fa1b3f4..7232af1ae 100644 --- a/src/java/org/apache/fop/fo/pagination/Declarations.java +++ b/src/java/org/apache/fop/fo/pagination/Declarations.java @@ -20,13 +20,13 @@ package org.apache.fop.fo.pagination; // Java -import java.util.Iterator; import java.util.Map; import org.xml.sax.Locator; import org.apache.fop.apps.FOPException; import org.apache.fop.fo.FONode; +import org.apache.fop.fo.FONode.FONodeIterator; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; @@ -77,9 +77,9 @@ public class Declarations extends FObj { * @see org.apache.fop.fo.FONode#endOfNode() */ protected void endOfNode() throws FOPException { - if (childNodes != null) { - for (Iterator iter = childNodes.iterator(); iter.hasNext();) { - FONode node = (FONode)iter.next(); + if (firstChild != null) { + for (FONodeIterator iter = getChildNodes(); iter.hasNext();) { + FONode node = iter.nextNode(); if (node.getName().equals("fo:color-profile")) { ColorProfile cp = (ColorProfile)node; if (!"".equals(cp.getColorProfileName())) { @@ -93,7 +93,7 @@ public class Declarations extends FObj { } } } - childNodes = null; + firstChild = null; } private void addColorProfile(ColorProfile cp) { diff --git a/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java b/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java index 69f621c65..e749044bb 100644 --- a/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java +++ b/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java @@ -72,7 +72,7 @@ public class LayoutMasterSet extends FObj { * @see org.apache.fop.fo.FONode#endOfNode */ protected void endOfNode() throws FOPException { - if (childNodes == null) { + if (firstChild == null) { missingChildElementError("(simple-page-master|page-sequence-master)+"); } checkRegionNames(); diff --git a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java index fc12205b7..efca3f740 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java @@ -83,7 +83,7 @@ public class PageSequenceMaster extends FObj { * @see org.apache.fop.fo.FONode#endOfNode() */ protected void endOfNode() throws FOPException { - if (childNodes == null) { + if (firstChild == null) { missingChildElementError("(single-page-master-reference|" + "repeatable-page-master-reference|repeatable-page-master-alternatives)+"); } diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java index f83bf005f..521a70787 100644 --- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java +++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java @@ -84,7 +84,7 @@ public class RepeatablePageMasterAlternatives extends FObj * @see org.apache.fop.fo.FONode#endOfNode */ protected void endOfNode() throws FOPException { - if (childNodes == null) { + if (firstChild == null) { missingChildElementError("(conditional-page-master-reference+)"); } } diff --git a/src/java/org/apache/fop/fo/pagination/StaticContent.java b/src/java/org/apache/fop/fo/pagination/StaticContent.java index 43f6806ca..cd55609cd 100644 --- a/src/java/org/apache/fop/fo/pagination/StaticContent.java +++ b/src/java/org/apache/fop/fo/pagination/StaticContent.java @@ -55,7 +55,7 @@ public class StaticContent extends Flow { * @see org.apache.fop.fo.FONode#endOfNode */ protected void endOfNode() throws FOPException { - if (childNodes == null && getUserAgent().validateStrictly()) { + if (firstChild == null && getUserAgent().validateStrictly()) { missingChildElementError("(%block;)+"); } getFOEventHandler().endFlow(this); -- cgit v1.2.3