From: Peter Herweg Date: Sun, 18 Jan 2004 21:21:41 +0000 (+0000) Subject: replaced string constants with int constants X-Git-Tag: Root_Temp_KnuthStylePageBreaking~910 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8c8657498b39bfe0b3f25d51ecdfa141a57cb400;p=xmlgraphics-fop.git replaced string constants with int constants git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197215 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java index f790e1d9a..693da979b 100644 --- a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java +++ b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java @@ -229,25 +229,25 @@ public class TableAttributesConverter { isBorderPresent=true; */ } - ep = (EnumProperty)props.get("border-top-style"); + ep = (EnumProperty)props.get(Constants.PR_BORDER_TOP_STYLE); if (ep != null && ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.CELL_BORDER_TOP, "\\" + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } - ep = (EnumProperty)props.get("border-bottom-style"); + ep = (EnumProperty)props.get(Constants.PR_BORDER_BOTTOM_STYLE); if (ep != null && ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.CELL_BORDER_BOTTOM, "\\" + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } - ep = (EnumProperty)props.get("border-left-style"); + ep = (EnumProperty)props.get(Constants.PR_BORDER_LEFT_STYLE); if (ep != null && ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.CELL_BORDER_LEFT, "\\" + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } - ep = (EnumProperty)props.get("border-right-style"); + ep = (EnumProperty)props.get(Constants.PR_BORDER_RIGHT_STYLE); if (ep != null && ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.CELL_BORDER_RIGHT, "\\" + convertAttributetoRtf(ep.getEnum())); @@ -272,7 +272,7 @@ public class TableAttributesConverter { // Column spanning : - NumberProperty n = (NumberProperty)props.get("number-columns-spanned"); + NumberProperty n = (NumberProperty)props.get(Constants.PR_NUMBER_COLUMNS_SPANNED); if (n != null && n.getNumber().intValue() > 1) { attrib.set(ITableAttributes.COLUMN_SPAN, n.getNumber().intValue()); } @@ -371,7 +371,7 @@ public class TableAttributesConverter { isBorderPresent=true; */ } - ep = (EnumProperty)props.get("border-top-style"); + ep = (EnumProperty)props.get(Constants.PR_BORDER_TOP_STYLE); if (ep != null && ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.ROW_BORDER_TOP, "\\" + convertAttributetoRtf(ep.getEnum())); @@ -379,7 +379,7 @@ public class TableAttributesConverter { + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } - ep = (EnumProperty)props.get("border-bottom-style"); + ep = (EnumProperty)props.get(Constants.PR_BORDER_BOTTOM_STYLE); if (ep != null && ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.ROW_BORDER_BOTTOM, "\\" + convertAttributetoRtf(ep.getEnum())); @@ -387,7 +387,7 @@ public class TableAttributesConverter { + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } - ep = (EnumProperty)props.get("border-left-style"); + ep = (EnumProperty)props.get(Constants.PR_BORDER_LEFT_STYLE); if (ep != null && ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.ROW_BORDER_LEFT, "\\" + convertAttributetoRtf(ep.getEnum())); @@ -395,7 +395,7 @@ public class TableAttributesConverter { + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } - ep = (EnumProperty)props.get("border-right-style"); + ep = (EnumProperty)props.get(Constants.PR_BORDER_RIGHT_STYLE); if (ep != null && ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.ROW_BORDER_RIGHT, "\\" + convertAttributetoRtf(ep.getEnum())); diff --git a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java index 33c9771a7..4d6dc9f73 100644 --- a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java +++ b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java @@ -155,7 +155,7 @@ class TextAttributesConverter { private static void attrBlockFontColor(PropertyList propertyList, RtfAttributes rtfAttr) { // Cell background color - ColorTypeProperty colorTypeProp = (ColorTypeProperty)propertyList.get("color"); + ColorTypeProperty colorTypeProp = (ColorTypeProperty)propertyList.get(Constants.PR_COLOR); if (colorTypeProp != null) { ColorType colorType = colorTypeProp.getColorType(); if (colorType != null) { @@ -222,7 +222,7 @@ class TextAttributesConverter { } //space-after - spaceProp = (SpaceProperty)propertyList.get("space-after"); + spaceProp = (SpaceProperty)propertyList.get(Constants.PR_SPACE_AFTER); if (spaceProp != null) { Float f = new Float( spaceProp.getLengthRange().getOptimum().getLength().getValue() / 1000f); @@ -243,7 +243,7 @@ class TextAttributesConverter { 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); String sValue = f.toString() + "pt"; @@ -256,7 +256,7 @@ class TextAttributesConverter { } // margin-right - lengthProp = (LengthProperty)propertyList.get("margin-right"); + lengthProp = (LengthProperty)propertyList.get(Constants.PR_MARGIN_RIGHT); if (lengthProp != null) { Float f = new Float(lengthProp.getLength().getValue() / 1000f); String sValue = f.toString() + "pt";