[seam-commits] Seam SVN: r11887 - in branches/community/Seam_2_2: src/excel/org/jboss/seam/excel/csv and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Dec 28 17:28:46 EST 2009


Author: danielc.roth
Date: 2009-12-28 17:28:46 -0500 (Mon, 28 Dec 2009)
New Revision: 11887

Modified:
   branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/ExcelTest.java
   branches/community/Seam_2_2/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java
Log:
JBSEAM-4187



Modified: branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/ExcelTest.java
===================================================================
--- branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/ExcelTest.java	2009-12-24 17:41:26 UTC (rev 11886)
+++ branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/ExcelTest.java	2009-12-28 22:28:46 UTC (rev 11887)
@@ -34,7 +34,7 @@
       people.add(new Person("Dan Allen", "Individual", "Seam-gen, Bug fixes"));
       people.add(new Person("Matt Drees", "Individual", "Seam Core"));
       people.add(new Person("Jacob Orshalick", "Focus IT Solutions LLC", ""));
-      people.add(new Person("Nicklas Karlsson", "Individual", "Excel reporting"));
+      people.add(new Person("Nicklas \"Nik\" Karlsson", "Individual", "Excel reporting"));
       people.add(new Person("Daniel Roth", "Individual", "Excel reporting"));
       people.add(new Person("Judy Guglielmin", "ICESoft Inc.", "ICEFaces integration"));
       people.add(new Person("Max Rydahl Andersen", "Red Hat Inc.", "Lead developer JBoss Tools, Hibernate Tools, Seam Tools"));

Modified: branches/community/Seam_2_2/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java
===================================================================
--- branches/community/Seam_2_2/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java	2009-12-24 17:41:26 UTC (rev 11886)
+++ branches/community/Seam_2_2/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java	2009-12-28 22:28:46 UTC (rev 11887)
@@ -31,6 +31,7 @@
    private int sheetStartRow = 0;
 
    private final static String DEFAULT_COLUMN_DELIMITER = "\"";
+   private final static String DEFAULT_COLUMN_DELIMITER_REPLACEMENT = "\"\"";
    private final static String DEFAULT_LINEBREAK = "\n";
    private final static String DEFAULT_COLUMN_SEPERATOR = ",";
 
@@ -39,6 +40,10 @@
 
    private Log log = Logging.getLog(getClass());
 
+   protected String getColumnDelimeterReplacement() {
+	   return DEFAULT_COLUMN_DELIMITER_REPLACEMENT;
+   }
+  
    protected String getColumnDelimeter() {
       return DEFAULT_COLUMN_DELIMITER;
    }
@@ -83,6 +88,8 @@
          {
             String value = table.get(hash(i, j));
             value = (value == null) ? "" : value;
+            if(value.contains(getColumnDelimeter()))
+            	value = value.replace(getColumnDelimeter(), getColumnDelimeterReplacement()); //JBSEAM-4187
             buffer.append(getColumnDelimeter()).append(value).append(getColumnDelimeter()).append(getColumnSeparator());
          }
          buffer.deleteCharAt(buffer.length() - 1);



More information about the seam-commits mailing list