]> source.dussan.org Git - poi.git/commitdiff
patch 55730: Fix org.apache.poi.ss.usermodel.BuiltinFormats.java for 0x29-0x2c
authorYegor Kozlov <yegor@apache.org>
Tue, 24 Dec 2013 05:58:23 +0000 (05:58 +0000)
committerYegor Kozlov <yegor@apache.org>
Tue, 24 Dec 2013 05:58:23 +0000 (05:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1553247 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ss/usermodel/BuiltinFormats.java
src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java

index 5fe6e13a8d57af9e7c1cf3f7d6fd50cf636a06c2..2dad6f813b0fe71b49377171ed47dd0b8ebcac7c 100644 (file)
@@ -54,10 +54,10 @@ import java.util.Map;
  *       0x26, "#,##0_);[Red](#,##0)"<br/>
  *       0x27, "#,##0.00_);(#,##0.00)"<br/>
  *       0x28, "#,##0.00_);[Red](#,##0.00)"<br/>
- *       0x29, "_(*#,##0_);_(*(#,##0);_(* \"-\"_);_(@_)"<br/>
- *       0x2a, "_($*#,##0_);_($*(#,##0);_($* \"-\"_);_(@_)"<br/>
- *       0x2b, "_(*#,##0.00_);_(*(#,##0.00);_(*\"-\"??_);_(@_)"<br/>
- *       0x2c, "_($*#,##0.00_);_($*(#,##0.00);_($*\"-\"??_);_(@_)"<br/>
+ *       0x29, "_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)"<br/>
+ *       0x2a, "_($* #,##0_);_($* (#,##0);_($* \"-\"_);_(@_)"<br/>
+ *       0x2b, "_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)"<br/>
+ *       0x2c, "_($* #,##0.00_);_($* (#,##0.00);_($* \"-\"??_);_(@_)"<br/>
  *       0x2d, "mm:ss"<br/>
  *       0x2e, "[h]:mm:ss"<br/>
  *       0x2f, "mm:ss.0"<br/>
@@ -69,6 +69,7 @@ import java.util.Map;
  * @author Yegor Kozlov
  *
  * Modified 6/17/09 by Stanislav Shor - positive formats don't need starting '('
+ * Modified 10/31/13 by Eric Peters - * is a repeating/padding character directive, examples needed a space after the asterix (e.i. Accounting format)
  *
  */
 public final class BuiltinFormats {
@@ -137,8 +138,8 @@ public final class BuiltinFormats {
                putFormat(m, 0x28, "#,##0.00_);[Red](#,##0.00)");
                putFormat(m, 0x29, "_(\"$\"* #,##0_);_(\"$\"* (#,##0);_(\"$\"* \"-\"_);_(@_)");
                putFormat(m, 0x2a, "_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)");
-               putFormat(m, 0x2b, "_(\"$\"* #,##0.00_);_(\"$\"* (#,##0.00);_(\"$\"* \"-\"??_);_(@_)");
-               putFormat(m, 0x2c, "_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)");
+               putFormat(m, 0x2b, "_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)");
+               putFormat(m, 0x2c, "_(\"$\"* #,##0.00_);_(\"$\"* (#,##0.00);_(\"$\"* \"-\"??_);_(@_)");
                putFormat(m, 0x2d, "mm:ss");
                putFormat(m, 0x2e, "[h]:mm:ss");
                putFormat(m, 0x2f, "mm:ss.0");
index f3bc27be5df576dbfc0382413042eaa528ea063b..ad144a2a3786e6509da56c02f1f7a40cb0942c9b 100644 (file)
@@ -57,7 +57,8 @@ public final class TestFormatTrackingHSSFListener extends TestCase {
 
                assertEquals("_(\"$\"* #,##0_);_(\"$\"* (#,##0);_(\"$\"* \"-\"_);_(@_)", listener.getFormatString(41));
                assertEquals("_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)", listener.getFormatString(42));
-               assertEquals("_(\"$\"* #,##0.00_);_(\"$\"* (#,##0.00);_(\"$\"* \"-\"??_);_(@_)", listener.getFormatString(43));
+               assertEquals("_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)", listener.getFormatString(43));
+               assertEquals("_(\"$\"* #,##0.00_);_(\"$\"* (#,##0.00);_(\"$\"* \"-\"??_);_(@_)", listener.getFormatString(44));
        }
        
        /**