gmazza 2003/12/29 15:28:47 Modified: src/java/org/apache/fop/datatypes LengthBase.java src/java/org/apache/fop/fo PropertyList.java src/java/org/apache/fop/fo/expr BodyStartFunction.java LabelEndFunction.java PropertyInfo.java src/java/org/apache/fop/fo/flow Marker.java TableRow.java src/java/org/apache/fop/fo/pagination PageSequenceMaster.java src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java AddLMVisitor.java BlockContainerLayoutManager.java PageLayoutManager.java src/java/org/apache/fop/render/rtf ListAttributesConverter.java PageAttributesConverter.java RTFHandler.java TableAttributesConverter.java TextAttributesConverter.java Log: More String->int conversions, annoyingly incremental but I'm getting there... Revision Changes Path 1.4 +2 -1 xml-fop/src/java/org/apache/fop/datatypes/LengthBase.java Index: LengthBase.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datatypes/LengthBase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- LengthBase.java 16 Jul 2003 01:52:26 -0000 1.3 +++ LengthBase.java 29 Dec 2003 23:28:47 -0000 1.4 @@ -51,6 +51,7 @@ package org.apache.fop.datatypes; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.Constants; import org.apache.fop.fo.PropertyList; /** @@ -139,7 +140,7 @@ public int getBaseLength() { switch (iBaseType) { case FONTSIZE: - return propertyList.get("font-size").getLength().getValue(); + return propertyList.get(Constants.PR_FONT_SIZE).getLength().getValue(); case INH_FONTSIZE: return propertyList.getInherited("font-size").getLength().getValue(); //case CONTAINING_BOX: 1.12 +1 -1 xml-fop/src/java/org/apache/fop/fo/PropertyList.java Index: PropertyList.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyList.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- PropertyList.java 27 Dec 2003 22:00:38 -0000 1.11 +++ PropertyList.java 29 Dec 2003 23:28:47 -0000 1.12 @@ -310,7 +310,7 @@ */ public Property get(String propertyName) { return get(propertyName, true, true); - } + } /** * Return the property on the current FlowObject. Depending on the passed flags, 1.4 +3 -2 xml-fop/src/java/org/apache/fop/fo/expr/BodyStartFunction.java Index: BodyStartFunction.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/expr/BodyStartFunction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- BodyStartFunction.java 20 Dec 2003 06:53:22 -0000 1.3 +++ BodyStartFunction.java 29 Dec 2003 23:28:47 -0000 1.4 @@ -50,6 +50,7 @@ */ package org.apache.fop.fo.expr; +import org.apache.fop.fo.Constants; import org.apache.fop.fo.Property; import org.apache.fop.fo.FONode; import org.apache.fop.fo.flow.ListItem; @@ -77,7 +78,7 @@ public Property eval(Property[] args, PropertyInfo pInfo) throws PropertyException { Numeric distance = - pInfo.getPropertyList().get("provisional-distance-between-starts").getNumeric(); + pInfo.getPropertyList().get(Constants.PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getNumeric(); FONode item = pInfo.getFO(); while (item != null && !(item instanceof ListItem)) { @@ -88,7 +89,7 @@ } Numeric startIndent = - ((ListItem)item).propertyList.get("start-indent").getNumeric(); + ((ListItem)item).propertyList.get(Constants.PR_START_INDENT).getNumeric(); return new NumericProperty(distance.add(startIndent)); } 1.4 +3 -2 xml-fop/src/java/org/apache/fop/fo/expr/LabelEndFunction.java Index: LabelEndFunction.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/expr/LabelEndFunction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- LabelEndFunction.java 20 Dec 2003 06:53:22 -0000 1.3 +++ LabelEndFunction.java 29 Dec 2003 23:28:47 -0000 1.4 @@ -54,6 +54,7 @@ import org.apache.fop.datatypes.LengthBase; import org.apache.fop.datatypes.LinearCombinationLength; import org.apache.fop.datatypes.PercentLength; +import org.apache.fop.fo.Constants; import org.apache.fop.fo.Property; import org.apache.fop.fo.LengthProperty; import org.apache.fop.fo.FONode; @@ -84,7 +85,7 @@ PropertyInfo pInfo) throws PropertyException { Length distance = - pInfo.getPropertyList().get("provisional-distance-between-starts").getLength(); + pInfo.getPropertyList().get(Constants.PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getLength(); Length separation = pInfo.getPropertyList().getNearestSpecified("provisional-label-separation").getLength(); @@ -95,7 +96,7 @@ if (item == null) { throw new PropertyException("label-end() called from outside an fo:list-item"); } - Length startIndent = ((ListItem)item).propertyList.get("start-indent").getLength(); + Length startIndent = ((ListItem)item).propertyList.get(Constants.PR_START_INDENT).getLength(); LinearCombinationLength labelEnd = new LinearCombinationLength(); 1.3 +2 -1 xml-fop/src/java/org/apache/fop/fo/expr/PropertyInfo.java Index: PropertyInfo.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/expr/PropertyInfo.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PropertyInfo.java 13 Jul 2003 03:16:11 -0000 1.2 +++ PropertyInfo.java 29 Dec 2003 23:28:47 -0000 1.3 @@ -52,6 +52,7 @@ import java.util.Stack; +import org.apache.fop.fo.Constants; import org.apache.fop.fo.Property; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.FObj; @@ -107,7 +108,7 @@ * @return the current font-size value as base units (milli-points). */ public int currentFontSize() { - return plist.get("font-size").getLength().getValue(); + return plist.get(Constants.PR_FONT_SIZE).getLength().getValue(); } /** 1.6 +1 -2 xml-fop/src/java/org/apache/fop/fo/flow/Marker.java Index: Marker.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Marker.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Marker.java 27 Dec 2003 22:00:38 -0000 1.5 +++ Marker.java 29 Dec 2003 23:28:47 -0000 1.6 @@ -55,7 +55,6 @@ // FOP import org.apache.fop.apps.FOPException; -import org.apache.fop.fo.Constants; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObjMixed; import org.apache.fop.fo.FOTreeVisitor; @@ -90,7 +89,7 @@ super.handleAttrs(attlist); this.markerClassName = - this.propertyList.get(Constants.PR_MARKER_CLASS_NAME).getString(); + this.propertyList.get(PR_MARKER_CLASS_NAME).getString(); } /** 1.10 +3 -3 xml-fop/src/java/org/apache/fop/fo/flow/TableRow.java Index: TableRow.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableRow.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- TableRow.java 22 Dec 2003 21:37:44 -0000 1.9 +++ TableRow.java 29 Dec 2003 23:28:47 -0000 1.10 @@ -128,16 +128,16 @@ // this.propertyList.get("keep-with-previous"); - this.breakAfter = this.propertyList.get("break-after").getEnum(); + this.breakAfter = this.propertyList.get(PR_BREAK_AFTER).getEnum(); this.backgroundColor = - this.propertyList.get("background-color").getColorType(); + this.propertyList.get(PR_BACKGROUND_COLOR).getColorType(); this.keepTogether = getKeepValue("keep-together.within-column"); this.keepWithNext = getKeepValue("keep-with-next.within-column"); this.keepWithPrevious = getKeepValue("keep-with-previous.within-column"); - this.minHeight = this.propertyList.get("height").getLength().getValue(); + this.minHeight = this.propertyList.get(PR_HEIGHT).getLength().getValue(); setup = true; } 1.5 +2 -1 xml-fop/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java Index: PageSequenceMaster.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PageSequenceMaster.java 20 Dec 2003 06:53:23 -0000 1.4 +++ PageSequenceMaster.java 29 Dec 2003 23:28:47 -0000 1.5 @@ -57,6 +57,7 @@ import org.xml.sax.Attributes; // FOP +import org.apache.fop.fo.Constants; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; import org.apache.fop.fo.FOTreeVisitor; @@ -99,7 +100,7 @@ if (parent.getName().equals("fo:layout-master-set")) { this.layoutMasterSet = (LayoutMasterSet)parent; - String pm = this.propertyList.get("master-name").getString(); + String pm = this.propertyList.get(Constants.PR_MASTER_NAME).getString(); if (pm == null) { getLogger().warn("page-sequence-master does not have " + "a master-name and so is being ignored"); 1.4 +2 -1 xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java Index: AbstractLayoutManager.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AbstractLayoutManager.java 12 Sep 2003 18:57:34 -0000 1.3 +++ AbstractLayoutManager.java 29 Dec 2003 23:28:47 -0000 1.4 @@ -56,6 +56,7 @@ import org.apache.fop.area.Area; import org.apache.fop.area.Resolveable; import org.apache.fop.area.PageViewport; +import org.apache.fop.fo.Constants; import org.apache.fop.fo.PropertyManager; import org.apache.avalon.framework.logger.Logger; @@ -66,7 +67,7 @@ /** * The base class for all LayoutManagers. */ -public abstract class AbstractLayoutManager implements LayoutProcessor { +public abstract class AbstractLayoutManager implements LayoutProcessor, Constants { protected FOUserAgent userAgent; protected LayoutProcessor parentLM = null; protected FObj fobj; 1.26 +16 -15 xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java Index: AddLMVisitor.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- AddLMVisitor.java 29 Dec 2003 20:50:41 -0000 1.25 +++ AddLMVisitor.java 29 Dec 2003 23:28:47 -0000 1.26 @@ -73,6 +73,7 @@ import org.apache.fop.area.inline.Viewport; import org.apache.fop.area.inline.TextArea; import org.apache.fop.datatypes.Length; +import org.apache.fop.fo.Constants; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FOText; import org.apache.fop.fo.FOTreeVisitor; @@ -352,7 +353,7 @@ }; lm.setUserAgent(node.getUserAgent()); lm.setFObj(node); - lm.setAlignment(node.propertyList.get("leader-alignment").getEnum()); + lm.setAlignment(node.propertyList.get(Constants.PR_LEADER_ALIGNMENT).getEnum()); currentLMList.add(lm); } @@ -460,7 +461,7 @@ } public InlineArea getCharacterInlineArea(Character node) { - String str = node.propertyList.get("character").getString(); + String str = node.propertyList.get(Constants.PR_CHARACTER).getString(); if (str.length() == 1) { org.apache.fop.area.inline.Character ch = new org.apache.fop.area.inline.Character( @@ -482,7 +483,7 @@ lm.setUserAgent(node.getUserAgent()); lm.setFObj(node); lm.setCurrentArea(area); - lm.setAlignment(node.propertyList.get("vertical-align").getEnum()); + lm.setAlignment(node.propertyList.get(Constants.PR_VERTICAL_ALIGN).getEnum()); lm.setLead(node.getViewHeight()); currentLMList.add(lm); } @@ -520,7 +521,7 @@ BlockContainerLayoutManager blm = new BlockContainerLayoutManager(); blm.setUserAgent(node.getUserAgent()); blm.setFObj(node); - blm.setOverflow(node.propertyList.get("overflow").getEnum()); + blm.setOverflow(node.propertyList.get(Constants.PR_OVERFLOW).getEnum()); currentLMList.add(blm); } @@ -538,7 +539,7 @@ lm.setUserAgent(node.getUserAgent()); lm.setFObj(node); lm.setCurrentArea(areaCurrent); - lm.setAlignment(node.propertyList.get("vertical-align").getEnum()); + lm.setAlignment(node.propertyList.get(Constants.PR_VERTICAL_ALIGN).getEnum()); lm.setLead(areaCurrent.getHeight()); currentLMList.add(lm); } @@ -580,27 +581,27 @@ int ipd = -1; boolean bpdauto = false; if (hasLH) { - bpd = node.propertyList.get("line-height").getLength().getValue(); + bpd = node.propertyList.get(Constants.PR_LINE_HEIGHT).getLength().getValue(); } else { // this property does not apply when the line-height applies // isn't the block-progression-dimension always in the same // direction as the line height? - len = node.propertyList.get("block-progression-dimension.optimum").getLength(); + len = node.propertyList.get(Constants.PR_BLOCK_PROGRESSION_DIMENSION | Constants.CP_OPTIMUM).getLength(); if (!len.isAuto()) { bpd = len.getValue(); } else { - len = node.propertyList.get("height").getLength(); + len = node.propertyList.get(Constants.PR_HEIGHT).getLength(); if (!len.isAuto()) { bpd = len.getValue(); } } } - len = node.propertyList.get("inline-progression-dimension.optimum").getLength(); + len = node.propertyList.get(Constants.PR_INLINE_PROGRESSION_DIMENSION | Constants.CP_OPTIMUM).getLength(); if (!len.isAuto()) { ipd = len.getValue(); } else { - len = node.propertyList.get("width").getLength(); + len = node.propertyList.get(Constants.PR_WIDTH).getLength(); if (!len.isAuto()) { ipd = len.getValue(); } @@ -610,7 +611,7 @@ // to the content-height and content-width int cwidth = -1; int cheight = -1; - len = node.propertyList.get("content-width").getLength(); + len = node.propertyList.get(Constants.PR_CONTENT_WIDTH).getLength(); if (!len.isAuto()) { /*if(len.scaleToFit()) { if(ipd != -1) { @@ -619,7 +620,7 @@ } else {*/ cwidth = len.getValue(); } - len = node.propertyList.get("content-height").getLength(); + len = node.propertyList.get(Constants.PR_CONTENT_HEIGHT).getLength(); if (!len.isAuto()) { /*if(len.scaleToFit()) { if(bpd != -1) { @@ -642,7 +643,7 @@ if (cheight == -1) { cheight = (int)size.getY() * 1000; } - int scaling = node.propertyList.get("scaling").getEnum(); + int scaling = node.propertyList.get(Constants.PR_SCALING).getEnum(); if (scaling == Scaling.UNIFORM) { // adjust the larger double rat1 = cwidth / (size.getX() * 1000f); @@ -664,7 +665,7 @@ boolean clip = false; if (cwidth > ipd || cheight > bpd) { - int overflow = node.propertyList.get("overflow").getEnum(); + int overflow = node.propertyList.get(Constants.PR_OVERFLOW).getEnum(); if (overflow == Overflow.HIDDEN) { clip = true; } else if (overflow == Overflow.ERROR_IF_OVERFLOW) { 1.10 +4 -4 xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java Index: BlockContainerLayoutManager.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- BlockContainerLayoutManager.java 28 Dec 2003 17:10:17 -0000 1.9 +++ BlockContainerLayoutManager.java 29 Dec 2003 23:28:47 -0000 1.10 @@ -107,14 +107,14 @@ absoluteCTM = CTM.getCTMandRelDims(pm.getAbsRefOrient(), pm.getWritingMode(), rect, relDims); } - height = pm.getPropertyList().get("height").getLength(); - width = pm.getPropertyList().get("width").getLength(); + height = pm.getPropertyList().get(PR_HEIGHT).getLength(); + width = pm.getPropertyList().get(PR_WIDTH).getLength(); } protected int getRotatedIPD() { PropertyList props = propManager.getPropertyList(); - int height = props.get("height").getLength().getValue(); - height = props.get("inline-progression-dimension.optimum").getLength().getValue(); + int height = props.get(PR_HEIGHT).getLength().getValue(); + height = props.get(PR_INLINE_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength().getValue(); return height; } 1.26 +5 -6 xml-fop/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java Index: PageLayoutManager.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- PageLayoutManager.java 22 Dec 2003 21:37:44 -0000 1.25 +++ PageLayoutManager.java 29 Dec 2003 23:28:47 -0000 1.26 @@ -70,8 +70,8 @@ import org.apache.fop.datatypes.FODimension; +import org.apache.fop.fo.Constants; import org.apache.fop.fo.flow.Marker; - import org.apache.fop.fo.pagination.PageNumberGenerator; import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.fo.pagination.Region; @@ -81,7 +81,6 @@ import org.apache.fop.fo.properties.CommonBackground; import org.apache.fop.fo.properties.CommonBorderAndPadding; import org.apache.fop.fo.properties.CommonMarginBlock; -import org.apache.fop.fo.Constants; import org.apache.fop.fo.properties.Overflow; import java.util.ArrayList; @@ -770,9 +769,9 @@ private PageViewport createPageAreas(SimplePageMaster spm) { int pageWidth = - spm.propertyList.get("page-width").getLength().getValue(); + spm.propertyList.get(PR_PAGE_WIDTH).getLength().getValue(); int pageHeight = - spm.propertyList.get("page-height").getLength().getValue(); + spm.propertyList.get(PR_PAGE_HEIGHT).getLength().getValue(); // Get absolute margin properties (top, left, bottom, right) CommonMarginBlock mProps = spm.getPropertyManager().getMarginProps(); @@ -858,7 +857,7 @@ BodyRegion body = new BodyRegion(); setRegionPosition(r, body, absRegVPRect); int columnCount = - r.propertyList.get("column-count").getNumber().intValue(); + r.propertyList.get(PR_COLUMN_COUNT).getNumber().intValue(); if ((columnCount > 1) && (r.overflow == Overflow.SCROLL)) { // recover by setting 'column-count' to 1. This is allowed but // not required by the spec. @@ -869,7 +868,7 @@ body.setColumnCount(columnCount); int columnGap = - r.propertyList.get("column-gap").getLength().getValue(); + r.propertyList.get(PR_COLUMN_GAP).getLength().getValue(); body.setColumnGap(columnGap); return body; } 1.4 +3 -2 xml-fop/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java Index: ListAttributesConverter.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ListAttributesConverter.java 20 Dec 2003 06:53:23 -0000 1.3 +++ ListAttributesConverter.java 29 Dec 2003 23:28:47 -0000 1.4 @@ -51,6 +51,7 @@ //FOP import org.apache.fop.apps.FOPException; +import org.apache.fop.fo.Constants; import org.apache.fop.fo.Property; import org.apache.fop.fo.LengthProperty; import org.apache.fop.fo.PropertyList; @@ -83,7 +84,7 @@ int iStartIndentInTwips = 0; //start-indent - if ((prop = propertyList.get("start-indent")) != null) { + if ((prop = propertyList.get(Constants.PR_START_INDENT)) != null) { LengthProperty lengthprop = (LengthProperty)prop; Float f = new Float(lengthprop.getLength().getValue() / 1000f); @@ -97,7 +98,7 @@ attrib.set(RtfListTable.LIST_INDENT, iStartIndentInTwips); //end-indent - if ((prop = propertyList.get("end-indent")) != null) { + if ((prop = propertyList.get(Constants.PR_END_INDENT)) != null) { LengthProperty lengthprop = (LengthProperty)prop; Float f = new Float(lengthprop.getLength().getValue() / 1000f); 1.3 +9 -8 xml-fop/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java Index: PageAttributesConverter.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PageAttributesConverter.java 8 Nov 2003 19:58:03 -0000 1.2 +++ PageAttributesConverter.java 29 Dec 2003 23:28:47 -0000 1.3 @@ -55,10 +55,11 @@ //FOP import org.apache.fop.apps.FOPException; +import org.apache.fop.fo.Constants; +import org.apache.fop.fo.Property; +import org.apache.fop.fo.PropertyList; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfPage; -import org.apache.fop.fo.PropertyList; -import org.apache.fop.fo.Property; /** Converts simple-page-master attributes into strings as defined in RtfPage. @@ -83,32 +84,32 @@ attrib = new RtfAttributes(); } - if ((p = props.get("page-width")) != null) { + if ((p = props.get(Constants.PR_PAGE_WIDTH)) != null) { Float f = new Float(p.getLength().getValue() / 1000f); attrib.set(RtfPage.PAGE_WIDTH, (int)FoUnitsConverter.getInstance().convertToTwips(f.toString() + "pt")); } - if ((p = props.get("page-height")) != null) { + if ((p = props.get(Constants.PR_PAGE_HEIGHT)) != null) { Float f = new Float(p.getLength().getValue() / 1000f); attrib.set(RtfPage.PAGE_HEIGHT, (int)FoUnitsConverter.getInstance().convertToTwips(f.toString() + "pt")); } - if ((p = props.get("margin-top")) != null) { + if ((p = props.get(Constants.PR_MARGIN_TOP)) != null) { Float f = new Float(p.getLength().getValue() / 1000f); attrib.set(RtfPage.MARGIN_TOP, (int)FoUnitsConverter.getInstance().convertToTwips(f.toString() + "pt")); } - if ((p = props.get("margin-bottom")) != null) { + if ((p = props.get(Constants.PR_MARGIN_BOTTOM)) != null) { Float f = new Float(p.getLength().getValue() / 1000f); attrib.set(RtfPage.MARGIN_BOTTOM, (int)FoUnitsConverter.getInstance().convertToTwips(f.toString() + "pt")); } - if ((p = props.get("margin-left")) != null) { + if ((p = props.get(Constants.PR_MARGIN_LEFT)) != null) { Float f = new Float(p.getLength().getValue() / 1000f); attrib.set(RtfPage.MARGIN_LEFT, (int)FoUnitsConverter.getInstance().convertToTwips(f.toString() + "pt")); } - if ((p = props.get("margin-right")) != null) { + if ((p = props.get(Constants.PR_MARGIN_RIGHT)) != null) { Float f = new Float(p.getLength().getValue() / 1000f); attrib.set(RtfPage.MARGIN_RIGHT, (int)FoUnitsConverter.getInstance().convertToTwips(f.toString() + "pt")); 1.11 +7 -7 xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java Index: RTFHandler.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- RTFHandler.java 22 Dec 2003 21:37:44 -0000 1.10 +++ RTFHandler.java 29 Dec 2003 23:28:47 -0000 1.11 @@ -183,7 +183,7 @@ //read page size and margins, if specified Property prop; - if ((prop = pageSeq.propertyList.get("master-reference")) != null) { + if ((prop = pageSeq.propertyList.get(Constants.PR_MASTER_REFERENCE)) != null) { String reference = prop.getString(); SimplePageMaster pagemaster @@ -580,7 +580,7 @@ //process number-rows-spanned attribute Property p = null; - if ((p = tc.propertyList.get("number-rows-spanned")) != null) { + if ((p = tc.propertyList.get(Constants.PR_NUMBER_ROWS_SPANNED)) != null) { // Start vertical merge cell.setVMerge(RtfTableCell.MERGE_START); @@ -757,7 +757,7 @@ Property p = null; //get source file - if ((p = eg.propertyList.get("src")) != null) { + if ((p = eg.propertyList.get(Constants.PR_SRC)) != null) { newGraphic.setURL (p.getString()); } else { log.error("The attribute 'src' of <fo:external-graphic> is required."); @@ -765,7 +765,7 @@ } //get scaling - if ((p = eg.propertyList.get("scaling")) != null) { + if ((p = eg.propertyList.get(Constants.PR_SCALING)) != null) { EnumProperty e = (EnumProperty)p; if (p.getEnum() == Constants.UNIFORM) { newGraphic.setScaling ("uniform"); @@ -773,7 +773,7 @@ } //get width - if ((p = eg.propertyList.get("width")) != null) { + if ((p = eg.propertyList.get(Constants.PR_WIDTH)) != null) { LengthProperty lengthProp = (LengthProperty)p; if (lengthProp.getLength() instanceof FixedLength) { Float f = new Float(lengthProp.getLength().getValue() / 1000f); @@ -783,7 +783,7 @@ } //get height - if ((p = eg.propertyList.get("height")) != null) { + if ((p = eg.propertyList.get(Constants.PR_HEIGHT)) != null) { LengthProperty lengthProp = (LengthProperty)p; if (lengthProp.getLength() instanceof FixedLength) { Float f = new Float(lengthProp.getLength().getValue() / 1000f); 1.6 +11 -11 xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java Index: TableAttributesConverter.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- TableAttributesConverter.java 22 Dec 2003 21:37:44 -0000 1.5 +++ TableAttributesConverter.java 29 Dec 2003 23:28:47 -0000 1.6 @@ -120,7 +120,7 @@ LengthProperty lengthProp = null; // margin-left - lengthProp = (LengthProperty)propertyList.get("margin-left"); + lengthProp = (LengthProperty)propertyList.get(Constants.PR_MARGIN_LEFT); if (lengthProp != null) { Float f = new Float(lengthProp.getLength().getValue() / 1000f); final String sValue = f.toString() + "pt"; @@ -218,7 +218,7 @@ } // Border styles do not inherit from parent - if ((p = props.get("border-style")) != null) { + if ((p = props.get(Constants.PR_BORDER_STYLE)) != null) { log.warn("border-style not implemented. Please use border-style-left, " + "...-right, ...-top or ...-bottom"); /* @@ -254,7 +254,7 @@ isBorderPresent = true; } - if ((p = props.get("border-width")) != null) { + if ((p = props.get(Constants.PR_BORDER_WIDTH)) != null) { ListProperty listprop = (ListProperty)p; LengthProperty lengthprop = (LengthProperty)listprop.getList().get(0); @@ -312,26 +312,26 @@ //need to set a default width //check for keep-together row attribute - if ((p = props.get("keep-together.within-page")) != null) { + if ((p = props.get(Constants.PR_KEEP_TOGETHER | Constants.CP_WITHIN_PAGE)) != null) { attrib.set(ITableAttributes.ROW_KEEP_TOGETHER); } - if ((p = props.get("keep-together")) != null) { + if ((p = props.get(Constants.PR_KEEP_TOGETHER)) != null) { attrib.set(ITableAttributes.ROW_KEEP_TOGETHER); } //Check for keep-with-next row attribute. - if ((p = props.get("keep-together")) != null) { + if ((p = props.get(Constants.PR_KEEP_WITH_NEXT)) != null) { attrib.set(ITableAttributes.ROW_KEEP_WITH_NEXT); } //Check for keep-with-previous row attribute. - if ((p = props.get("keep-with-previous")) != null) { + if ((p = props.get(Constants.PR_KEEP_WITH_PREVIOUS)) != null) { attrib.set(ITableAttributes.ROW_KEEP_WITH_PREVIOUS); } //Check for height row attribute. - if ((p = props.get("height")) != null) { + if ((p = props.get(Constants.PR_HEIGHT)) != null) { Float f = new Float(p.getLength().getValue() / 1000); attrValue = f.toString() + "pt"; attrib.set(ITableAttributes.ROW_HEIGHT, @@ -351,7 +351,7 @@ * it is implemented that the border type is the value of the border * place. */ - if ((p = props.get("border-style")) != null) { + if ((p = props.get(Constants.PR_BORDER_STYLE)) != null) { log.warn("border-style not implemented. Please use border-style-left, " + "...-right, ...-top or ...-bottom"); /* @@ -424,7 +424,7 @@ isBorderPresent = true; } - if ((p = props.get("border-width")) != null) { + if ((p = props.get(Constants.PR_BORDER_WIDTH)) != null) { ListProperty listprop = (ListProperty)p; LengthProperty lengthprop = (LengthProperty)listprop.getList().get(0); 1.7 +8 -8 xml-fop/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java Index: TextAttributesConverter.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TextAttributesConverter.java 22 Dec 2003 21:37:44 -0000 1.6 +++ TextAttributesConverter.java 29 Dec 2003 23:28:47 -0000 1.7 @@ -140,7 +140,7 @@ private static void attrBlockFontFamily(PropertyList propertyList, RtfAttributes rtfAttr) { - String fopValue = propertyList.get("font-family").getString(); + String fopValue = propertyList.get(Constants.PR_FONT_FAMILY).getString(); if (fopValue != null) { rtfAttr.set(RtfText.ATTR_FONT_FAMILY, @@ -149,7 +149,7 @@ } private static void attrBlockFontSize(PropertyList propertyList, RtfAttributes rtfAttr) { - int fopValue = propertyList.get("font-size").getLength().getValue() / 500; + int fopValue = propertyList.get(Constants.PR_FONT_SIZE).getLength().getValue() / 500; rtfAttr.set("fs", fopValue); } @@ -176,7 +176,7 @@ private static void attrBlockFontWeight(PropertyList propertyList, RtfAttributes rtfAttr) { - String fopValue = propertyList.get("font-weight").getString(); + String fopValue = propertyList.get(Constants.PR_FONT_WEIGHT).getString(); if (fopValue == "bold" || fopValue == "700") { rtfAttr.set("b", 1); } else { @@ -185,7 +185,7 @@ } private static void attrBlockFontItalic(PropertyList propertyList, RtfAttributes rtfAttr) { - String fopValue = propertyList.get("font-style").getString(); + String fopValue = propertyList.get(Constants.PR_FONT_STYLE).getString(); if (fopValue.equals("italic")) { rtfAttr.set(RtfText.ATTR_ITALIC, 1); } else { @@ -194,7 +194,7 @@ } private static void attrBlockFontUnderline(PropertyList propertyList, RtfAttributes rtfAttr) { - EnumProperty enumProp = (EnumProperty)propertyList.get("text-decoration"); + EnumProperty enumProp = (EnumProperty) propertyList.get(Constants.PR_TEXT_DECORATION); if (enumProp.getEnum() == Constants.UNDERLINE) { rtfAttr.set(RtfText.ATTR_UNDERLINE, 1); } else { @@ -206,7 +206,7 @@ SpaceProperty spaceProp = null; //space-before - spaceProp = (SpaceProperty)propertyList.get("space-before"); + spaceProp = (SpaceProperty)propertyList.get(Constants.PR_SPACE_BEFORE); if (spaceProp != null) { Float f = new Float( spaceProp.getLengthRange().getOptimum().getLength().getValue() / 1000f); @@ -275,7 +275,7 @@ private static void attrBlockTextAlign(PropertyList propertyList, RtfAttributes rtfAttr) { - int fopValue = propertyList.get("text-align").getEnum(); + int fopValue = propertyList.get(Constants.PR_TEXT_ALIGN).getEnum(); String rtfValue = null; switch (fopValue) { case Constants.CENTER: @@ -302,7 +302,7 @@ * @param rtfAttr the RtfAttributes object the attributes are written to */ private static void attrBlockBackgroundColor(PropertyList propertyList, RtfAttributes rtfAttr) { - ColorType fopValue = propertyList.get("background-color").getColorType(); + ColorType fopValue = propertyList.get(Constants.PR_BACKGROUND_COLOR).getColorType(); int rtfColor = 0; /* FOP uses a default background color of "transparent", which is actually a transparent black, which is generally not suitable as a
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]