From bed3ab6871d3424245d986fad3e237224a9134dd Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 10 Jul 2008 18:41:25 +0000 Subject: [PATCH] Fix bug #45365 - Handle more excel number formatting rules in FormatTrackingHSSFListener / XLS2CSVmra git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@675671 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/changes.xml | 1 + src/documentation/content/xdocs/status.xml | 1 + .../eventusermodel/examples/XLS2CSVmra.java | 48 +------------- .../FormatTrackingHSSFListener.java | 62 ++++++++++++++++++ .../org/apache/poi/hssf/data/45365.xls | Bin 0 -> 51712 bytes .../TestFormatTrackingHSSFListener.java | 43 ++++++++++-- 6 files changed, 105 insertions(+), 50 deletions(-) create mode 100644 src/testcases/org/apache/poi/hssf/data/45365.xls diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 16a82aa3ae..808bea2a9c 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -37,6 +37,7 @@ + 45365 - Handle more excel number formatting rules in FormatTrackingHSSFListener / XLS2CSVmra 45373 - Improve the performance of HSSFSheet.shiftRows 45367 - Fixed bug when last row removed from sheet is row zero 45348 - Tweaks to RVA formula logic diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 7143b98d78..21d279ada1 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 45365 - Handle more excel number formatting rules in FormatTrackingHSSFListener / XLS2CSVmra 45373 - Improve the performance of HSSFSheet.shiftRows 45367 - Fixed bug when last row removed from sheet is row zero 45348 - Tweaks to RVA formula logic diff --git a/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java b/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java index 1c9b220356..632eacf5cc 100644 --- a/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java +++ b/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java @@ -20,10 +20,6 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintStream; -import java.text.DateFormat; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.Date; import org.apache.poi.hssf.eventusermodel.FormatTrackingHSSFListener; import org.apache.poi.hssf.eventusermodel.HSSFEventFactory; @@ -37,7 +33,6 @@ import org.apache.poi.hssf.model.FormulaParser; import org.apache.poi.hssf.record.BOFRecord; import org.apache.poi.hssf.record.BlankRecord; import org.apache.poi.hssf.record.BoolErrRecord; -import org.apache.poi.hssf.record.CellValueRecordInterface; import org.apache.poi.hssf.record.FormulaRecord; import org.apache.poi.hssf.record.LabelRecord; import org.apache.poi.hssf.record.LabelSSTRecord; @@ -47,7 +42,6 @@ import org.apache.poi.hssf.record.RKRecord; import org.apache.poi.hssf.record.Record; import org.apache.poi.hssf.record.SSTRecord; import org.apache.poi.hssf.record.StringRecord; -import org.apache.poi.hssf.usermodel.HSSFDateUtil; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.POIFSFileSystem; @@ -180,7 +174,7 @@ public class XLS2CSVmra implements HSSFListener { nextRow = frec.getRow(); nextColumn = frec.getColumn(); } else { - thisStr = formatNumberDateCell(frec, frec.getValue()); + thisStr = formatListener.formatNumberDateCell(frec); } } else { thisStr = '"' + @@ -231,7 +225,7 @@ public class XLS2CSVmra implements HSSFListener { thisColumn = numrec.getColumn(); // Format - thisStr = formatNumberDateCell(numrec, numrec.getValue()); + thisStr = formatListener.formatNumberDateCell(numrec); break; case RKRecord.sid: RKRecord rkrec = (RKRecord) record; @@ -290,44 +284,6 @@ public class XLS2CSVmra implements HSSFListener { } } - /** - * Formats a number or date cell, be that a real number, or the - * answer to a formula - */ - private String formatNumberDateCell(CellValueRecordInterface cell, double value) { - // Get the built in format, if there is one - int formatIndex = formatListener.getFormatIndex(cell); - String formatString = formatListener.getFormatString(cell); - - if(formatString == null) { - return Double.toString(value); - } else { - // Is it a date? - if(HSSFDateUtil.isADateFormat(formatIndex,formatString) && - HSSFDateUtil.isValidExcelDate(value)) { - // Java wants M not m for month - formatString = formatString.replace('m','M'); - // Change \- into -, if it's there - formatString = formatString.replaceAll("\\\\-","-"); - - // Format as a date - Date d = HSSFDateUtil.getJavaDate(value, false); - DateFormat df = new SimpleDateFormat(formatString); - return df.format(d); - } else { - if(formatString == "General") { - // Some sort of wierd default - return Double.toString(value); - } - - // Format as a number - DecimalFormat df = new DecimalFormat(formatString); - return df.format(value); - } - } - } - - public static void main(String[] args) throws Exception { if(args.length < 1) { System.err.println("Use:"); diff --git a/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java b/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java index b88143713d..5a84f45646 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java @@ -16,7 +16,11 @@ ==================================================================== */ package org.apache.poi.hssf.eventusermodel; +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.Hashtable; import java.util.List; import java.util.Map; @@ -24,8 +28,11 @@ import java.util.Map; import org.apache.poi.hssf.record.CellValueRecordInterface; import org.apache.poi.hssf.record.ExtendedFormatRecord; import org.apache.poi.hssf.record.FormatRecord; +import org.apache.poi.hssf.record.FormulaRecord; +import org.apache.poi.hssf.record.NumberRecord; import org.apache.poi.hssf.record.Record; import org.apache.poi.hssf.usermodel.HSSFDataFormat; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; /** * A proxy HSSFListener that keeps track of the document @@ -69,6 +76,61 @@ public class FormatTrackingHSSFListener implements HSSFListener { } } + /** + * Formats the given numeric of date Cell's contents + * as a String, in as close as we can to the way + * that Excel would do so. + * Uses the various format records to manage this. + * + * TODO - move this to a central class in such a + * way that hssf.usermodel can make use of it too + */ + public String formatNumberDateCell(CellValueRecordInterface cell) { + double value; + if(cell instanceof NumberRecord) { + value = ((NumberRecord)cell).getValue(); + } else if(cell instanceof FormulaRecord) { + value = ((FormulaRecord)cell).getValue(); + } else { + throw new IllegalArgumentException("Unsupported CellValue Record passed in " + cell); + } + + // Get the built in format, if there is one + int formatIndex = getFormatIndex(cell); + String formatString = getFormatString(cell); + + if(formatString == null) { + return Double.toString(value); + } else { + // Is it a date? + if(HSSFDateUtil.isADateFormat(formatIndex,formatString) && + HSSFDateUtil.isValidExcelDate(value)) { + // Java wants M not m for month + formatString = formatString.replace('m','M'); + // Change \- into -, if it's there + formatString = formatString.replaceAll("\\\\-","-"); + + // Format as a date + Date d = HSSFDateUtil.getJavaDate(value, false); + DateFormat df = new SimpleDateFormat(formatString); + return df.format(d); + } else { + if(formatString == "General") { + // Some sort of wierd default + return Double.toString(value); + } + if(formatString == "0.00E+00") { + // This seems to mean output as a normal double + return Double.toString(value); + } + + // Format as a number + DecimalFormat df = new DecimalFormat(formatString); + return df.format(value); + } + } + } + /** * Returns the format string, eg $##.##, for the * given number format index. diff --git a/src/testcases/org/apache/poi/hssf/data/45365.xls b/src/testcases/org/apache/poi/hssf/data/45365.xls new file mode 100644 index 0000000000000000000000000000000000000000..fbf1d97c589d0c82c232b0578b4ced79d75c6b71 GIT binary patch literal 51712 zcmeHw2YggT*Zyo0lBEZT5D;+*Eg&WI^lTcTgd#-*f+U1cLqZ8nMHdS;M5HN2jR+!$ z2uN391x3`T*s!4n6hTBqv7oP#|9Q^2H<|3-4e;vweSH7lyZOz@+~>}ndFGUvxpVI( zhu*GL{P^YuN0rAXUiqu@C6!g6hTABQ#GhcLMoqtu*I3rgXXT2g97=^9F{DYc>0mQp)P5tQ0f z>OiR@rB0MOQ|dygE2T(EQIw)7#ZZc+6h|qZQUWC>r9?_el#(f>P)eoLjZzw=?v#2^ z>Pe{=rF2TY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{P1mctc!`C z8p-dPVMR?wk99dQ%e-9q;U0nbxh_|JxL+ZDg_kQo z+&d9J_vOkD_i@Cp_;TfkdrIP`vYn8UzdWSGFYa%Nnd5ThhkI?}=e%6`;l7{vWnQlQ zum?f>T$d|9?1vD)!po80hsvpbu0#LP!mm(O{8NLz!E9Y3-mkXW9*7+jCnbESx9UE7 zFeN@TM3TCS-a7Yxln-s{QTm~Gb!-k*IV_l7F2|=9z4(`v-GK5PbEA3$yPdl;%=qrtg1u_zuUGp zi-nSIqBFcmwauP7eT==H8e`BvaX)1%p^twGy<=!z{(ti~Q~*sux#y`%PzzKTLXd3ws!0ju$&CCP>iF;H|DFcUmry9!JYt1x3co16^Rb_P?>jd5=?CrV znikJ}96?wiCHMx;J1GTF>P`v1l0gZnYWv1YIC@ zCQ(9vW>SJKT$JcRj=Gx?bhLmH^zjiTT}ROCfJsxv<462W;Ur zoT=u7w(x>mG$v>SC5*-+WHhcu^}rsm75XqZf69cZV{>u}rZN?D7pFkKPu9eoQI7su zd1G?QP8LuJ@W-b+C0uZh61d?2{jt+;w9$}$W9)I#Z;U^g^c#LQ);PvBA(TcWj_RJD z-9KmgxSScuv$At@df;!q$e1)Dbz;`I+yT=@j?c+1;95a#MB=o9vH4T@95)f_0j7+b zIw?167P`PqH^ljVQ>cmjX;Uql1FiZfBP_<{jTxAqpF4HH*!&rJee<$&O6><;!B;%d z-SqW7se>IUi9OPX5Dp9tjmn!gcFMSj_RgtnLiR7Ps)krn|lB=jqz12s(i>Ux{Fy&$jUSyd| zZT}*xz35{9m)p0|?CnnzJo@0Ub7U&F^t>BJin8&y@95FvvU6k@c65k{=;$aN4>)X+ j#*H40{}@33^9v(&+W{CU+D59Mqqa 0); + } + } + + // TODO - test some specific format strings + } + private static final class MockHSSFListener implements HSSFListener { public MockHSSFListener() {} private final List _records = new ArrayList();