]> source.dussan.org Git - poi.git/commitdiff
lgtm issue
authorPJ Fanning <fanningpj@apache.org>
Sun, 17 Jul 2022 10:00:17 +0000 (10:00 +0000)
committerPJ Fanning <fanningpj@apache.org>
Sun, 17 Jul 2022 10:00:17 +0000 (10:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902804 13f79535-47bb-0310-9956-ffa450edef68

poi-examples/src/main/java/org/apache/poi/examples/ss/AddDimensionedImage.java

index c41e4c0007ccd856231e375cf5aeb0fdd85055e7..67fbb68142d07635bac506fb5f9a491e3326dd55 100644 (file)
@@ -949,10 +949,10 @@ public class AddDimensionedImage {
          * pixel units to excel width units(units of 1/256th of a character width)
          */
         public static short pixel2WidthUnits(int pxs) {
-            short widthUnits = (short) (EXCEL_COLUMN_WIDTH_FACTOR *
+            int widthUnits = (EXCEL_COLUMN_WIDTH_FACTOR *
                     (pxs / UNIT_OFFSET_LENGTH));
             widthUnits += UNIT_OFFSET_MAP[(pxs % UNIT_OFFSET_LENGTH)];
-            return widthUnits;
+            return (short) widthUnits;
         }
 
         /**