]> source.dussan.org Git - poi.git/commitdiff
Allow negative numbers in conditional part of format string
authorDominik Stadler <centic@apache.org>
Fri, 19 Mar 2021 09:40:10 +0000 (09:40 +0000)
committerDominik Stadler <centic@apache.org>
Fri, 19 Mar 2021 09:40:10 +0000 (09:40 +0000)
Closes #229

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887802 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ss/format/CellFormatPart.java
test-data/spreadsheet/FormatConditionTests.xlsx

index 2c65ca865df67e53f3b2f42a0ffe9b2a32c351d1..c03dbc5795d8b20c289c20e29c23187d311fce4f 100644 (file)
@@ -108,7 +108,7 @@ public class CellFormatPart {
     static {
         // A condition specification
         String condition = "([<>=]=?|!=|<>)    # The operator\n" +
-                "  \\s*([0-9]+(?:\\.[0-9]*)?)\\s*  # The constant to test against\n";
+                "  \\s*(-?[0-9]+(?:\\.[0-9]*)?)\\s*  # The constant to test against\n";
 
         // A currency symbol / string, in a specific locale
         String currency = "(\\[\\$.{0,3}-[0-9a-f]{3}\\])";
index 22622586f86fc313244b68f889b643c7546d5657..432e54630a77da9a6cc62c162e370cdb439783d6 100644 (file)
Binary files a/test-data/spreadsheet/FormatConditionTests.xlsx and b/test-data/spreadsheet/FormatConditionTests.xlsx differ