Try to deal with encoding
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 15 Oct 2009 15:02:32 +0000 (15:02 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 15 Oct 2009 15:02:32 +0000 (15:02 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@3039 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

server/runtime/org.argeo.server.jxl/src/main/java/org/argeo/server/jxl/dao/JxlDaoSupport.java

index dbd0793d9244e69aecfb8a9678b1a4fcfb7cede1..fecd7f2911bfd0b1bd0439d021536110bf874b0a 100644 (file)
@@ -1,7 +1,6 @@
 package org.argeo.server.jxl.dao;
 
 import java.io.InputStream;
-import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -10,8 +9,11 @@ import java.util.Map;
 import java.util.TreeMap;
 
 import jxl.Cell;
+import jxl.CellType;
 import jxl.FormulaCell;
 import jxl.JXLException;
+import jxl.LabelCell;
+import jxl.NumberCell;
 import jxl.Sheet;
 import jxl.Workbook;
 import jxl.WorkbookSettings;
@@ -168,6 +170,17 @@ public class JxlDaoSupport implements LightDaoSupport, ApplicationContextAware,
                                                + ", targetRow=" + targetRow);
                } else {
                        String contents = cell.getContents();
+
+//                     if (cell.getType() == CellType.LABEL) {
+//                             LabelCell lc = (LabelCell) cell;
+//                             contents = lc.getString();
+//                     } else if (cell.getType() == CellType.NUMBER) {
+//                             NumberCell nc = (NumberCell) cell;
+//                             contents = new Double(nc.getValue()).toString();
+//                     } else {
+//                             contents = cell.getContents();
+//                     }
+
                        if (propertyName.equals(keyProperty)
                                        && !StringUtils.hasText(contents)) {
                                // auto allocate key column if empty