diff options
author | Andreas L. Delmelle <adelmelle@apache.org> | 2007-07-07 01:07:10 +0000 |
---|---|---|
committer | Andreas L. Delmelle <adelmelle@apache.org> | 2007-07-07 01:07:10 +0000 |
commit | 69b7925f5cdbd813a4136705ee7a19e9af6f28fc (patch) | |
tree | b51e50a5278f70c4e07f0c37650f0cada298badd /src/java/org/apache/fop/fo/pagination | |
parent | 5abb46f263e647dee70d173e60d803928fc9e45c (diff) | |
download | xmlgraphics-fop-69b7925f5cdbd813a4136705ee7a19e9af6f28fc.tar.gz xmlgraphics-fop-69b7925f5cdbd813a4136705ee7a19e9af6f28fc.zip |
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
Diffstat (limited to 'src/java/org/apache/fop/fo/pagination')
5 files changed, 9 insertions, 9 deletions
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); |