]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
replaced string constants with int constants
authorPeter Herweg <pherweg@apache.org>
Sun, 18 Jan 2004 21:21:41 +0000 (21:21 +0000)
committerPeter Herweg <pherweg@apache.org>
Sun, 18 Jan 2004 21:21:41 +0000 (21:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197215 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
src/java/org/apache/fop/render/rtf/TextAttributesConverter.java

index f790e1d9a65e9916fb9f339d3eb224c3e71363a8..693da979bb0fb80a0fada67e9fed9d5a4519616a 100644 (file)
@@ -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()));
index 33c9771a7ac36c67a35ae9d44b64dd77636efbde..4d6dc9f73ac957b03ceba0f0d690d45e4a1ba295 100644 (file)
@@ -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";