diff options
author | Simon Steiner <ssteiner@apache.org> | 2015-08-12 13:58:15 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2015-08-12 13:58:15 +0000 |
commit | cdab44e72103fb13f4400f54025b1f0af77cd0e6 (patch) | |
tree | d009dd8e9958125c1e71406193e09d981608fe00 /src/java | |
parent | 3b36d2319cf02aa9e480114dbc539dd7fc576278 (diff) | |
download | xmlgraphics-fop-cdab44e72103fb13f4400f54025b1f0af77cd0e6.tar.gz xmlgraphics-fop-cdab44e72103fb13f4400f54025b1f0af77cd0e6.zip |
FOP-2510: Flow name infinite Loop
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1695517 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/PageSequence.java | 14 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java | 4 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index d17abf623..6afd15e81 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -193,7 +193,7 @@ public class PageSequence extends AbstractPageSequence implements WritingModeTra * @throws org.apache.fop.fo.ValidationException if the fo:flow maps * to an invalid page-region */ - private void addFlow(Flow flow) throws ValidationException { + private void addFlow(Flow flow) throws ValidationException { String flowName = flow.getFlowName(); if (hasFlowName(flowName)) { @@ -201,14 +201,20 @@ public class PageSequence extends AbstractPageSequence implements WritingModeTra flowName, flow.getLocator()); } - if (!getRoot().getLayoutMasterSet().regionNameExists(flowName) - && !flowName.equals("xsl-before-float-separator") - && !flowName.equals("xsl-footnote-separator")) { + if (!hasRegion(flowName) && !flowName.equals("xsl-before-float-separator") + && !flowName.equals("xsl-footnote-separator")) { getFOValidationEventProducer().flowNameNotMapped(this, flow.getName(), flowName, flow.getLocator()); } } + private boolean hasRegion(String flowName) { + LayoutMasterSet set = getRoot().getLayoutMasterSet(); + PageSequenceMaster psm = set.getPageSequenceMaster(masterReference); + return (psm != null) ? psm.getLayoutMasterSet().regionNameExists(flowName) + : set.getSimplePageMaster(masterReference).regionNameExists(flowName); + } + /** * Get the static content FO node from the flow map. * This gets the static content flow for the given flow name. diff --git a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java index 6fa9b4261..86d5ff663 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java @@ -117,6 +117,10 @@ public class PageSequenceMaster extends FObj { subSequenceSpecifiers.add(pageMasterReference); } + public LayoutMasterSet getLayoutMasterSet() { + return layoutMasterSet; + } + /** * Returns the next subsequence specifier * @return a subsequence specifier |