pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1774903 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java
Date Sun, 18 Dec 2016 16:41:21 GMT
Author: tilman
Date: Sun Dec 18 16:41:21 2016
New Revision: 1774903

URL: http://svn.apache.org/viewvc?rev=1774903&view=rev
Log:
PDFBOX-2852: Sonar fixes

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java?rev=1774903&r1=1774902&r2=1774903&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java
Sun Dec 18 16:41:21 2016
@@ -116,7 +116,7 @@ public class PDType3Font extends PDSimpl
     {
         int firstChar = dict.getInt(COSName.FIRST_CHAR, -1);
         int lastChar = dict.getInt(COSName.LAST_CHAR, -1);
-        if (getWidths().size() > 0 && code >= firstChar && code <=
lastChar)
+        if (!getWidths().isEmpty() && code >= firstChar && code <=
lastChar)
         {
             Float w = getWidths().get(code - firstChar);
             return w == null ? 0 : w;
@@ -161,11 +161,11 @@ public class PDType3Font extends PDSimpl
             // the following values are all more or less accurate at least all are average
             // values. Maybe we'll find another way to get those value for every single glyph
             // in the future if needed
-            PDRectangle fontBBox = desc.getFontBoundingBox();
+            PDRectangle bbox = desc.getFontBoundingBox();
             float retval = 0;
-            if (fontBBox != null)
+            if (bbox != null)
             {
-                retval = fontBBox.getHeight() / 2;
+                retval = bbox.getHeight() / 2;
             }
             if (retval == 0)
             {
@@ -234,10 +234,10 @@ public class PDType3Font extends PDSimpl
     {
         if (resources == null)
         {
-            COSDictionary resources = (COSDictionary) dict.getDictionaryObject(COSName.RESOURCES);
-            if (resources != null)
+            COSDictionary resourcesDict = (COSDictionary) dict.getDictionaryObject(COSName.RESOURCES);
+            if (resourcesDict != null)
             {
-                this.resources = new PDResources(resources);
+                this.resources = new PDResources(resourcesDict);
             }
         }
         return resources;



Mime
View raw message