diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-06-24 15:08:08 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-06-24 15:08:08 +0000 |
commit | 9cdd8f0bfebfd2ac1e6e386f24cfe7d4c3ba859f (patch) | |
tree | ce7abcc8e7d4b06ff6a93b0ad52c3a33e1940f45 /src/java/org/apache | |
parent | 9ac24fca324390196b51ebf2bee583c9f35e6019 (diff) | |
download | xmlgraphics-fop-9cdd8f0bfebfd2ac1e6e386f24cfe7d4c3ba859f.tar.gz xmlgraphics-fop-9cdd8f0bfebfd2ac1e6e386f24cfe7d4c3ba859f.zip |
Check the proper use of the span attribute.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@201627 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/fop/fo/FObj.java | 16 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/flow/Block.java | 2 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/flow/BlockContainer.java | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index b2b79eceb..f9a0ca73d 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -27,6 +27,7 @@ import java.util.Set; import org.apache.fop.apps.FOPException; import org.apache.fop.datatypes.PercentBase; import org.apache.fop.fo.flow.Marker; +import org.apache.fop.fo.pagination.Flow; import org.apache.fop.fo.properties.PropertyMaker; import org.xml.sax.Attributes; import org.xml.sax.Locator; @@ -146,6 +147,21 @@ public abstract class FObj extends FONode implements Constants { } } + /** + * Checks the block-level FO for correct use of the span attribute. + * Used by fo:block and fo:block-container. + * @param pList the property list to determine if the span is explicit + */ + protected void checkSpanProperty(PropertyList pList) { + if (pList.getExplicit(PR_SPAN) != null) { + if (!(getParent() instanceof Flow)) { + attributeWarning("Ignoring span attribute on " + getName() + + " as it's not a direct child of an fo:flow." + + " (see XSL 1.0, 7.20.4)"); + } + } + } + /** * Returns Out Of Line FO Descendant indicator. * @return true if Out of Line FO or Out Of Line descendant, false otherwise diff --git a/src/java/org/apache/fop/fo/flow/Block.java b/src/java/org/apache/fop/fo/flow/Block.java index a1c03be5a..5c9fcc23d 100644 --- a/src/java/org/apache/fop/fo/flow/Block.java +++ b/src/java/org/apache/fop/fo/flow/Block.java @@ -160,6 +160,8 @@ public class Block extends FObjMixed { whiteSpaceCollapse = pList.get(PR_WHITE_SPACE_COLLAPSE).getEnum(); widows = pList.get(PR_WIDOWS).getNumeric(); wrapOption = pList.get(PR_WRAP_OPTION).getEnum(); + + checkSpanProperty(pList); } /** diff --git a/src/java/org/apache/fop/fo/flow/BlockContainer.java b/src/java/org/apache/fop/fo/flow/BlockContainer.java index c7d1acd5d..4afa50272 100644 --- a/src/java/org/apache/fop/fo/flow/BlockContainer.java +++ b/src/java/org/apache/fop/fo/flow/BlockContainer.java @@ -96,6 +96,8 @@ public class BlockContainer extends FObj { width = pList.get(PR_WIDTH).getLength(); writingMode = pList.get(PR_WRITING_MODE).getEnum(); zIndex = pList.get(PR_Z_INDEX).getNumeric(); + + checkSpanProperty(pList); } /** |