From f736e2c65bf916b1ac124f99f82b972cdd0b0368 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sun, 17 Jul 2022 10:00:17 +0000 Subject: [PATCH] lgtm issue git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902804 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/examples/ss/AddDimensionedImage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/AddDimensionedImage.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/AddDimensionedImage.java index c41e4c0007..67fbb68142 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/AddDimensionedImage.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/AddDimensionedImage.java @@ -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; } /**