Author: tilman
Date: Sun Mar 17 10:52:20 2019
New Revision: 1855690
URL: http://svn.apache.org/viewvc?rev=1855690&view=rev
Log:
PDFBOX-4480: SonarQube fix
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java?rev=1855690&r1=1855689&r2=1855690&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java Sun
Mar 17 10:52:20 2019
@@ -176,7 +176,8 @@ class LegacyPDFStreamEngine extends PDFS
if (fontDescriptor != null)
{
float capHeight = fontDescriptor.getCapHeight();
- if (Float.compare(capHeight, 0) != 0 && (capHeight < glyphHeight ||
Float.compare(glyphHeight, 0) == 0))
+ if (Float.compare(capHeight, 0) != 0 &&
+ (capHeight < glyphHeight || Float.compare(glyphHeight, 0) == 0))
{
glyphHeight = capHeight;
}
@@ -184,7 +185,8 @@ class LegacyPDFStreamEngine extends PDFS
// sometimes even CapHeight has very high value, but Ascent and Descent are ok
float ascent = fontDescriptor.getAscent();
float descent = fontDescriptor.getDescent();
- if (ascent > 0 && descent < 0 && ((ascent - descent) /
2 < glyphHeight || glyphHeight == 0))
+ if (ascent > 0 && descent < 0 &&
+ ((ascent - descent) / 2 < glyphHeight || Float.compare(glyphHeight, 0)
== 0))
{
glyphHeight = (ascent - descent) / 2;
}
|