]> source.dussan.org Git - poi.git/commitdiff
forgot another contains call ...
authorAndreas Beeker <kiwiwings@apache.org>
Wed, 16 Mar 2016 23:40:00 +0000 (23:40 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Wed, 16 Mar 2016 23:40:00 +0000 (23:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1735349 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ss/format/CellNumberFormatter.java

index 2097e6c909fe7a80c71a5201f2cb4b3213d34452..230d245546d28274865be2f1c7b707f998c34f22 100644 (file)
@@ -641,14 +641,14 @@ public class CellNumberFormatter extends CellFormatter {
                 // New we check to see if we should remove the integer part
                 boolean numNoZero = !hasChar('0', numeratorSpecials);
                 boolean intNoZero = !hasChar('0', integerSpecials);
-                boolean intOnlyHash = integerSpecials.isEmpty() || (integerSpecials.size() == 1 && integerSpecials.contains('#'));
+                boolean intOnlyHash = integerSpecials.isEmpty() || (integerSpecials.size() == 1 && hasChar('#', integerSpecials));
 
                 boolean removeBecauseZero     = fractional == 0 && (intOnlyHash || numNoZero);
                 boolean removeBecauseFraction = fractional != 0 && intNoZero;
 
                 if (value == 0 && (removeBecauseZero || removeBecauseFraction)) {
                     Special start = lastSpecial(integerSpecials);
-                    boolean hasPlaceHolder = integerSpecials.contains('?') || numeratorSpecials.contains('?');
+                    boolean hasPlaceHolder = hasChar('?', integerSpecials, numeratorSpecials);
                     CellNumberStringMod sm = hasPlaceHolder
                         ? replaceMod(start, true, numerator, false, ' ')
                         : deleteMod(start, true, numerator, false);