pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1799760 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/NamingTable.java
Date Sat, 24 Jun 2017 11:24:36 GMT
Author: tilman
Date: Sat Jun 24 11:24:36 2017
New Revision: 1799760

URL: http://svn.apache.org/viewvc?rev=1799760&view=rev
Log:
PDFBOX-2852: use switch

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/NamingTable.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/NamingTable.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/NamingTable.java?rev=1799760&r1=1799759&r2=1799760&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/NamingTable.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/NamingTable.java Sat Jun 24
11:24:36 2017
@@ -94,18 +94,20 @@ public class NamingTable extends TTFTabl
             }
             else if (platform == NameRecord.PLATFORM_ISO)
             {
-                if (encoding == 0)
+                switch (encoding)
                 {
-                    charset = Charsets.US_ASCII;
-                }
-                else if (encoding == 1)
-                {
-                    //not sure is this is correct??
-                    charset = Charsets.ISO_10646;
-                }
-                else if (encoding == 2)
-                {
-                    charset = Charsets.ISO_8859_1;
+                    case 0:
+                        charset = Charsets.US_ASCII;
+                        break;
+                    case 1:
+                        //not sure is this is correct??
+                        charset = Charsets.ISO_10646;
+                        break;
+                    case 2:
+                        charset = Charsets.ISO_8859_1;
+                        break;
+                    default:
+                        break;
                 }
             }
             String string = data.readString(nr.getStringLength(), charset);



Mime
View raw message