diff options
author | PJ Fanning <fanningpj@apache.org> | 2022-08-19 02:21:15 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2022-08-19 02:21:15 +0000 |
commit | b8cd36030001addba4e9f9687308349d5356c789 (patch) | |
tree | 54904ce83289c5f1dfd01a46d36e8002f334d166 /poi | |
parent | ceb6caa1d5508f0591e97a1bfe2f48501cb4ebf8 (diff) | |
download | poi-b8cd36030001addba4e9f9687308349d5356c789.tar.gz poi-b8cd36030001addba4e9f9687308349d5356c789.zip |
some int narrowing
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903551 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
3 files changed, 5 insertions, 5 deletions
diff --git a/poi/src/main/java/org/apache/poi/poifs/property/Property.java b/poi/src/main/java/org/apache/poi/poifs/property/Property.java index 92bcb9f603..ca34dbd76f 100644 --- a/poi/src/main/java/org/apache/poi/poifs/property/Property.java +++ b/poi/src/main/java/org/apache/poi/poifs/property/Property.java @@ -271,12 +271,12 @@ public abstract class Property implements Child, POIFSViewable { for (; j < limit; j++) { new ShortField(offset, ( short ) char_array[ j ], _raw_data); - offset += LittleEndianConsts.SHORT_SIZE; + offset += (short) LittleEndianConsts.SHORT_SIZE; } for (; j < _max_name_length + 1; j++) { new ShortField(offset, ( short ) 0, _raw_data); - offset += LittleEndianConsts.SHORT_SIZE; + offset += (short) LittleEndianConsts.SHORT_SIZE; } // double the count, and include the null at the end diff --git a/poi/src/main/java/org/apache/poi/sl/draw/DrawTextParagraph.java b/poi/src/main/java/org/apache/poi/sl/draw/DrawTextParagraph.java index ac29af9e4e..b0cd9598de 100644 --- a/poi/src/main/java/org/apache/poi/sl/draw/DrawTextParagraph.java +++ b/poi/src/main/java/org/apache/poi/sl/draw/DrawTextParagraph.java @@ -368,9 +368,9 @@ public class DrawTextParagraph implements Drawable { buSz = 100d; } if (buSz > 0) { - fontSize *= buSz* 0.01; + fontSize *= (float) (buSz * 0.01); } else { - fontSize = (float)-buSz; + fontSize = (float) -buSz; } String buFontStr = bulletStyle.getBulletFont(); diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java b/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java index ee4d787e9e..3a7c0102fd 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java @@ -694,7 +694,7 @@ public class CellNumberFormatter extends CellFormatter { d = frac.getDenominator(); } if (improperFraction) { - n += Math.round(value * d); + n = Math.toIntExact(n + Math.round(value * d)); } writeSingleInteger(numeratorFmt, n, output, numeratorSpecials, mods); writeSingleInteger(denominatorFmt, d, output, denominatorSpecials, mods); |