svn commit: r1805622 - in /xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop: fonts/CIDFontType.java pdf/PDFText.java

[email protected]
Newsgroups gmane.text.xml.fop.cvs
Message-ID <[email protected]>
Author: ssteiner
Date: Mon Aug 21 11:52:08 2017
New Revision: 1805622

URL: http://svn.apache.org/viewvc?rev=1805622&view=rev
Log:
FOP-2733: Reduce dependency on Avalon Framework

Modified:
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/CIDFontType.java
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFText.java

Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/CIDFontType.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/CIDFontType.java?rev=1805622&r1=1805621&r2=1805622&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/CIDFontType.java (original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/CIDFontType.java Mon Aug 21 11:52:08 2017
@@ -19,32 +19,32 @@
 
 package org.apache.fop.fonts;
 
-import org.apache.avalon.framework.ValuedEnum;
-
 /**
  * This class enumerates all supported CID font types.
  */
-public class CIDFontType extends ValuedEnum {
+public enum CIDFontType {
 
     /**
      * CID Font Type 0 (based on Type 1 format)
      */
-    public static final CIDFontType CIDTYPE0 = new CIDFontType("CIDFontType0", 0);
+    CIDTYPE0("CIDFontType0", 0),
 
     /**
      * CID Font Type 2 (based on TrueType format)
      */
-    public static final CIDFontType CIDTYPE2 = new CIDFontType("CIDFontType2", 2);
+    CIDTYPE2("CIDFontType2", 2);
 
+    private final String name;
+    private final int value;
 
     /**
      * Construct a CID font type.
      * @param name a type name
      * @param value a type value
-     * @see org.apache.avalon.framework.Enum#Enum(String)
      */
-    protected CIDFontType(String name, int value) {
-        super(name, value);
+    CIDFontType(String name, int value) {
+        this.name = name;
+        this.value = value;
     }
 
 
@@ -79,4 +79,11 @@ public class CIDFontType extends ValuedE
         }
     }
 
+    public String getName() {
+        return name;
+    }
+
+    public int getValue() {
+        return value;
+    }
 }

Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFText.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFText.java?rev=1805622&r1=1805621&r2=1805622&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFText.java (original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFText.java Mon Aug 21 11:52:08 2017
@@ -21,8 +21,6 @@ package org.apache.fop.pdf;
 
 import java.io.ByteArrayOutputStream;
 
-import org.apache.avalon.framework.CascadingRuntimeException;
-
 /**
  * This class represents a simple number object. It also contains contains some
  * utility methods for outputting numbers to PDF.
@@ -101,7 +99,7 @@ public class PDFText extends PDFObject {
                 try {
                     uniBytes = text.getBytes("UTF-16");
                 } catch (java.io.UnsupportedEncodingException uee) {
-                    throw new CascadingRuntimeException("Incompatible VM", uee);
+                    throw new RuntimeException("Incompatible VM", uee);
                 }
                 return toHex(uniBytes);
             } else {
@@ -179,7 +177,7 @@ public class PDFText extends PDFObject {
         try {
             return text.getBytes("UnicodeBig");
         } catch (java.io.UnsupportedEncodingException uee) {
-            throw new CascadingRuntimeException("Incompatible VM", uee);
+            throw new RuntimeException("Incompatible VM", uee);
         }
     }
 
@@ -195,7 +193,7 @@ public class PDFText extends PDFObject {
             final char[] a = {c};
             uniBytes = new String(a).getBytes("UTF-16BE");
         } catch (java.io.UnsupportedEncodingException uee) {
-            throw new CascadingRuntimeException("Incompatible VM", uee);
+            throw new RuntimeException("Incompatible VM", uee);
         }
 
         for (byte uniByte : uniBytes) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.