]> source.dussan.org Git - poi.git/commitdiff
FindBug warning: ICAST_IDIV_CAST_TO_DOUBLE: integral division result cast to double
authorJaven O'Neal <onealj@apache.org>
Tue, 24 Nov 2015 01:11:57 +0000 (01:11 +0000)
committerJaven O'Neal <onealj@apache.org>
Tue, 24 Nov 2015 01:11:57 +0000 (01:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1716005 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ss/util/ImageUtils.java

index 16176682ad512421bde9e6bdfcec9f96700bbe28..0e7de24eec71e69ab39d4c42996ade5c0bfad3dd 100644 (file)
@@ -158,9 +158,9 @@ public class ImageUtils {
         //space in the leftmost cell\r
         w = sheet.getColumnWidthInPixels(col2++);\r
         if (isHSSF) {\r
-            w *= 1 - anchor.getDx1()/1024d;\r
+            w *= 1d - anchor.getDx1()/1024d;\r
         } else {\r
-            w -= anchor.getDx1()/EMU_PER_PIXEL;\r
+            w -= anchor.getDx1()/(double)EMU_PER_PIXEL;\r
         }\r
         \r
         while(w < scaledWidth){\r
@@ -280,6 +280,6 @@ public class ImageUtils {
     private static double getRowHeightInPixels(Sheet sheet, int rowNum) {\r
         Row r = sheet.getRow(rowNum);\r
         double points = (r == null) ? sheet.getDefaultRowHeightInPoints() : r.getHeightInPoints();\r
-        return Units.toEMU(points)/EMU_PER_PIXEL;\r
+        return Units.toEMU(points)/(double)EMU_PER_PIXEL;\r
     }\r
 }\r