aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-01-14 00:00:38 +0000
committerGlen Mazza <gmazza@apache.org>2004-01-14 00:00:38 +0000
commit8eebf16fad2dd677255adb054cc4cab17dc3d7af (patch)
tree13f8627ec8be327e3dd45e307ff85ecf46c8d1c2 /src
parent3c5e2946bb93e544ce909bb9a91250ea28927a59 (diff)
downloadxmlgraphics-fop-8eebf16fad2dd677255adb054cc4cab17dc3d7af.tar.gz
xmlgraphics-fop-8eebf16fad2dd677255adb054cc4cab17dc3d7af.zip
More String->Int conversions (ones I've missed previously.) Appears I've finally
converted all of them. From Finn Bock's patch. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197159 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/fo/FObj.java5
-rw-r--r--src/java/org/apache/fop/fo/flow/TableRow.java9
-rw-r--r--src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java4
-rw-r--r--src/java/org/apache/fop/fo/pagination/Flow.java2
-rw-r--r--src/java/org/apache/fop/fo/pagination/PageMasterReference.java4
-rw-r--r--src/java/org/apache/fop/fo/pagination/RegionBody.java11
-rw-r--r--src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java2
-rw-r--r--src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java2
-rw-r--r--src/java/org/apache/fop/render/mif/MIFHandler.java3
9 files changed, 20 insertions, 22 deletions
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java
index 172c5bf99..16a8aa115 100644
--- a/src/java/org/apache/fop/fo/FObj.java
+++ b/src/java/org/apache/fop/fo/FObj.java
@@ -258,8 +258,7 @@ public class FObj extends FONode implements Constants {
* @param name - the name of the desired property to obtain
* @return the property
*/
- public Property getProperty(String name) {
- int propId = FOPropertyMapping.getPropertyId(name);
+ public Property getProperty(int propId) {
return (propertyList.get(propId));
}
@@ -330,7 +329,7 @@ public class FObj extends FONode implements Constants {
protected void setWritingMode() {
FObj p = findNearestAncestorGeneratingRAs(true, true);
this.propertyList.setWritingMode(
- p.getProperty("writing-mode").getEnum());
+ p.getProperty(PR_WRITING_MODE).getEnum());
}
/**
diff --git a/src/java/org/apache/fop/fo/flow/TableRow.java b/src/java/org/apache/fop/fo/flow/TableRow.java
index 2225ac94c..c74354a48 100644
--- a/src/java/org/apache/fop/fo/flow/TableRow.java
+++ b/src/java/org/apache/fop/fo/flow/TableRow.java
@@ -133,17 +133,16 @@ public class TableRow extends FObj {
this.backgroundColor =
this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
- this.keepTogether = getKeepValue("keep-together.within-column");
- this.keepWithNext = getKeepValue("keep-with-next.within-column");
+ this.keepTogether = getKeepValue(PR_KEEP_TOGETHER | CP_WITHIN_COLUMN);
+ this.keepWithNext = getKeepValue(PR_KEEP_WITH_NEXT | CP_WITHIN_COLUMN);
this.keepWithPrevious =
- getKeepValue("keep-with-previous.within-column");
+ getKeepValue(PR_KEEP_WITH_PREVIOUS | CP_WITHIN_COLUMN);
this.minHeight = this.propertyList.get(PR_HEIGHT).getLength().getValue();
setup = true;
}
- private KeepValue getKeepValue(String sPropName) {
- int propId = FOPropertyMapping.getPropertyId(sPropName);
+ private KeepValue getKeepValue(int propId) {
Property p = this.propertyList.get(propId);
Number n = p.getNumber();
if (n != null) {
diff --git a/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java b/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
index 210193d7e..e1a74743e 100644
--- a/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
+++ b/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
@@ -92,8 +92,8 @@ public class ConditionalPageMasterReference extends FObj {
*/
public void handleAttrs(Attributes attlist) throws FOPException {
super.handleAttrs(attlist);
- if (getProperty("master-reference") != null) {
- setMasterName(getProperty("master-reference").getString());
+ if (getProperty(PR_MASTER_REFERENCE) != null) {
+ setMasterName(getProperty(PR_MASTER_REFERENCE).getString());
}
validateParent(parent);
diff --git a/src/java/org/apache/fop/fo/pagination/Flow.java b/src/java/org/apache/fop/fo/pagination/Flow.java
index 4f89ec739..981b7066b 100644
--- a/src/java/org/apache/fop/fo/pagination/Flow.java
+++ b/src/java/org/apache/fop/fo/pagination/Flow.java
@@ -122,7 +122,7 @@ public class Flow extends FObj {
}
}
*/
- setFlowName(getProperty("flow-name").getString());
+ setFlowName(getProperty(PR_FLOW_NAME).getString());
// Now done in addChild of page-sequence
//pageSequence.addFlow(this);
diff --git a/src/java/org/apache/fop/fo/pagination/PageMasterReference.java b/src/java/org/apache/fop/fo/pagination/PageMasterReference.java
index aa12108cf..892d93000 100644
--- a/src/java/org/apache/fop/fo/pagination/PageMasterReference.java
+++ b/src/java/org/apache/fop/fo/pagination/PageMasterReference.java
@@ -80,8 +80,8 @@ public abstract class PageMasterReference extends FObj
*/
public void handleAttrs(Attributes attlist) throws FOPException {
super.handleAttrs(attlist);
- if (getProperty("master-reference") != null) {
- this.masterName = getProperty("master-reference").getString();
+ if (getProperty(PR_MASTER_REFERENCE) != null) {
+ this.masterName = getProperty(PR_MASTER_REFERENCE).getString();
}
validateParent(parent);
}
diff --git a/src/java/org/apache/fop/fo/pagination/RegionBody.java b/src/java/org/apache/fop/fo/pagination/RegionBody.java
index 38b0f8cd0..4d10a6df8 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionBody.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionBody.java
@@ -89,18 +89,18 @@ public class RegionBody extends Region {
* set but indent is explicitly set, it will return that.
*/
CommonMarginBlock mProps = propMgr.getMarginProps();
- int start = getRelMargin(PropertyList.START, "start-indent");
+ int start = getRelMargin(PropertyList.START, PR_START_INDENT);
Rectangle vpRect;
if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB) {
vpRect = new Rectangle(start, mProps.spaceBefore,
reldims.ipd - start
- - getRelMargin(PropertyList.END, "end-indent"),
+ - getRelMargin(PropertyList.END, PR_END_INDENT),
reldims.bpd - mProps.spaceBefore - mProps.spaceAfter);
} else {
vpRect = new Rectangle(start, mProps.spaceBefore,
reldims.bpd - mProps.spaceBefore - mProps.spaceAfter,
reldims.ipd - start
- - getRelMargin(PropertyList.END, "end-indent"));
+ - getRelMargin(PropertyList.END, PR_END_INDENT));
}
return vpRect;
}
@@ -109,15 +109,14 @@ public class RegionBody extends Region {
* Get the relative margin using parent's writing mode, not own
* writing mode.
*/
- private int getRelMargin(int reldir, String sRelPropName) {
+ private int getRelMargin(int reldir, int relPropId) {
FObj parent = (FObj) getParent();
String sPropName = "margin-"
+ parent.propertyList.wmRelToAbs(reldir);
int propId = FOPropertyMapping.getPropertyId(sPropName);
Property prop = propertyList.getExplicitBaseProp(propId);
if (prop == null) {
- propId = FOPropertyMapping.getPropertyId(sRelPropName);
- prop = propertyList.getExplicitBaseProp(propId);
+ prop = propertyList.getExplicitBaseProp(relPropId);
}
return ((prop != null) ? prop.getLength().getValue() : 0);
}
diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
index dfd3f8b6f..8bd054e87 100644
--- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
+++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
@@ -106,7 +106,7 @@ public class RepeatablePageMasterAlternatives extends FObj
+ parent.getName());
}
- String mr = getProperty("maximum-repeats").getString();
+ String mr = getProperty(PR_MAXIMUM_REPEATS).getString();
if (mr.equals("no-limit")) {
this.maximumRepeats = INFINITE;
} else {
diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
index 48ab82c88..b7b9fa15c 100644
--- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
+++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
@@ -86,7 +86,7 @@ public class RepeatablePageMasterReference extends PageMasterReference
public void handleAttrs(Attributes attlist) throws FOPException {
super.handleAttrs(attlist);
- String mr = getProperty("maximum-repeats").getString();
+ String mr = getProperty(PR_MAXIMUM_REPEATS).getString();
if (mr.equals("no-limit")) {
this.maximumRepeats = INFINITE;
} else {
diff --git a/src/java/org/apache/fop/render/mif/MIFHandler.java b/src/java/org/apache/fop/render/mif/MIFHandler.java
index 9b787c8c9..64d9c9b6d 100644
--- a/src/java/org/apache/fop/render/mif/MIFHandler.java
+++ b/src/java/org/apache/fop/render/mif/MIFHandler.java
@@ -56,6 +56,7 @@ import java.io.OutputStream;
import org.apache.fop.apps.Document;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FOInputHandler;
import org.apache.fop.fo.flow.BasicLink;
import org.apache.fop.fo.flow.Block;
@@ -144,7 +145,7 @@ public class MIFHandler extends FOInputHandler {
public void startPageSequence(PageSequence pageSeq) {
// get the layout master set
// setup the pages for this sequence
- String name = pageSeq.getProperty("master-reference").getString();
+ String name = pageSeq.getProperty(Constants.PR_MASTER_REFERENCE).getString();
SimplePageMaster spm = pageSeq.getLayoutMasterSet().getSimplePageMaster(name);
if (spm == null) {
PageSequenceMaster psm = pageSeq.getLayoutMasterSet().getPageSequenceMaster(name);