pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1850318 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderStyleDictionary.java
Date Fri, 04 Jan 2019 07:17:49 GMT
Author: tilman
Date: Fri Jan  4 07:17:49 2019
New Revision: 1850318

URL: http://svn.apache.org/viewvc?rev=1850318&view=rev
Log:
PDFBOX-3353: use constants

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderStyleDictionary.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderStyleDictionary.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderStyleDictionary.java?rev=1850318&r1=1850317&r2=1850318&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderStyleDictionary.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderStyleDictionary.java
Fri Jan  4 07:17:49 2019
@@ -19,6 +19,7 @@ package org.apache.pdfbox.pdmodel.intera
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSInteger;
+import org.apache.pdfbox.cos.COSName;
 
 import org.apache.pdfbox.pdmodel.common.COSObjectable;
 import org.apache.pdfbox.pdmodel.graphics.PDLineDashPattern;
@@ -107,11 +108,11 @@ public class PDBorderStyleDictionary imp
         // PDFBOX-3929 workaround 
         if (Float.compare(w, (int) w) == 0)
         {
-            getCOSObject().setInt("W", (int) w);
+            getCOSObject().setInt(COSName.W, (int) w);
         }
         else
         {
-            getCOSObject().setFloat("W", w);
+            getCOSObject().setFloat(COSName.W, w);
         }
     }
 
@@ -122,7 +123,7 @@ public class PDBorderStyleDictionary imp
      */
     public float getWidth()
     {
-        return getCOSObject().getFloat("W", 1);
+        return getCOSObject().getFloat(COSName.W, 1);
     }
 
     /**
@@ -132,7 +133,7 @@ public class PDBorderStyleDictionary imp
      */
     public void setStyle(String s)
     {
-        getCOSObject().setName("S", s);
+        getCOSObject().setName(COSName.S, s);
     }
 
     /**
@@ -142,7 +143,7 @@ public class PDBorderStyleDictionary imp
      */
     public String getStyle()
     {
-        return getCOSObject().getNameAsString("S", STYLE_SOLID);
+        return getCOSObject().getNameAsString(COSName.S, STYLE_SOLID);
     }
 
     /**
@@ -157,7 +158,7 @@ public class PDBorderStyleDictionary imp
         {
             array = dashArray;
         }
-        getCOSObject().setItem("D", array);
+        getCOSObject().setItem(COSName.D, array);
     }
 
     /**
@@ -167,12 +168,12 @@ public class PDBorderStyleDictionary imp
      */
     public PDLineDashPattern getDashStyle()
     {
-        COSArray d = (COSArray) getCOSObject().getDictionaryObject("D");
+        COSArray d = (COSArray) getCOSObject().getDictionaryObject(COSName.D);
         if (d == null)
         {
             d = new COSArray();
             d.add(COSInteger.THREE);
-            getCOSObject().setItem("D", d);
+            getCOSObject().setItem(COSName.D, d);
         }
         return new PDLineDashPattern(d, 0);
     }



Mime
View raw message