aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
diff options
context:
space:
mode:
authorFinn Bock <bckfnn@apache.org>2004-09-07 20:14:51 +0000
committerFinn Bock <bckfnn@apache.org>2004-09-07 20:14:51 +0000
commit3d9c0841e9c45fa0708c19a6526f26cdfb55f926 (patch)
tree77074379304e9cb4308e3e638a86f994745393c7 /src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
parent32d770ded2fc32a290ad59564f9e12495579e3dd (diff)
downloadxmlgraphics-fop-3d9c0841e9c45fa0708c19a6526f26cdfb55f926.tar.gz
xmlgraphics-fop-3d9c0841e9c45fa0708c19a6526f26cdfb55f926.zip
Make maximum-repeats a number property instead of a string. This add
support for expression. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197932 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java')
-rw-r--r--src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
index 32c8a14b0..4ad7ab074 100644
--- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
+++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
@@ -26,6 +26,7 @@ import org.xml.sax.SAXParseException;
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.properties.Property;
/**
* A repeatable-page-master-reference formatting object.
@@ -62,21 +63,16 @@ public class RepeatablePageMasterReference extends FObj
pageSequenceMaster.addSubsequenceSpecifier(this);
}
- String mr = getPropString(PR_MAXIMUM_REPEATS);
+ Property mr = getProperty(PR_MAXIMUM_REPEATS);
- if (mr.equals("no-limit")) {
+ if (mr.getEnum() == NO_LIMIT) {
this.maximumRepeats = INFINITE;
} else {
- try {
- this.maximumRepeats = Integer.parseInt(mr);
- if (this.maximumRepeats < 0) {
- getLogger().debug("negative maximum-repeats: "
- + this.maximumRepeats);
- this.maximumRepeats = 0;
- }
- } catch (NumberFormatException nfe) {
- throw new SAXParseException("Invalid number for "
- + "'maximum-repeats' property", locator);
+ this.maximumRepeats = mr.getNumber().intValue();
+ if (this.maximumRepeats < 0) {
+ getLogger().debug("negative maximum-repeats: "
+ + this.maximumRepeats);
+ this.maximumRepeats = 0;
}
}
}