[seam-commits] Seam SVN: r9753 - in trunk/src/excel/org/jboss/seam/excel: jxl and 1 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Dec 11 02:41:43 EST 2008


Author: nickarls
Date: 2008-12-11 02:41:43 -0500 (Thu, 11 Dec 2008)
New Revision: 9753

Modified:
   trunk/src/excel/org/jboss/seam/excel/WorksheetItem.java
   trunk/src/excel/org/jboss/seam/excel/jxl/JXLExcelWorkbook.java
   trunk/src/excel/org/jboss/seam/excel/ui/UICell.java
   trunk/src/excel/org/jboss/seam/excel/ui/UIHyperlink.java
   trunk/src/excel/org/jboss/seam/excel/ui/UIImage.java
Log:
Better null-handling (JBSEAM-3682 & JBSEAM-3830)

Modified: trunk/src/excel/org/jboss/seam/excel/WorksheetItem.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/WorksheetItem.java	2008-12-11 00:42:44 UTC (rev 9752)
+++ trunk/src/excel/org/jboss/seam/excel/WorksheetItem.java	2008-12-11 07:41:43 UTC (rev 9753)
@@ -9,5 +9,11 @@
    }
 
    public abstract ItemType getItemType();
+   
+   public abstract Object getValue();
+   
+   public Integer getColumn();
+   
+   public Integer getRow();
 
 }

Modified: trunk/src/excel/org/jboss/seam/excel/jxl/JXLExcelWorkbook.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/jxl/JXLExcelWorkbook.java	2008-12-11 00:42:44 UTC (rev 9752)
+++ trunk/src/excel/org/jboss/seam/excel/jxl/JXLExcelWorkbook.java	2008-12-11 07:41:43 UTC (rev 9753)
@@ -251,17 +251,6 @@
                     "Can't add cells before creating worksheet");
         }
 
-        Object value = uiCell.getValue();
-        // If value is null, just increment row counter (not for explicitly
-        // placed
-        // single cells) and return;
-        if (value == null) {
-            if (uiCell.getColumn() == null && uiCell.getRow() == null) {
-                nextRow();
-            }
-            return;
-        }
-
         // Determine where to really place the cell
         int useRow = uiCell.getRow() != null ? uiCell.getRow()
                 : currentRowIndex;
@@ -505,6 +494,12 @@
         if (!((UIComponent) item).isRendered()) {
             return;
         }
+        if (item.getValue() == null) {
+            if (item.getColumn() == null && item.getRow() == null) {
+                nextRow();
+            }
+            return;
+        }
         switch (item.getItemType()) {
         case cell:
             addCell((UICell) item);

Modified: trunk/src/excel/org/jboss/seam/excel/ui/UICell.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UICell.java	2008-12-11 00:42:44 UTC (rev 9752)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UICell.java	2008-12-11 07:41:43 UTC (rev 9753)
@@ -109,4 +109,5 @@
       return ItemType.cell;
    }
 
+
 }

Modified: trunk/src/excel/org/jboss/seam/excel/ui/UIHyperlink.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UIHyperlink.java	2008-12-11 00:42:44 UTC (rev 9752)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UIHyperlink.java	2008-12-11 07:41:43 UTC (rev 9753)
@@ -84,4 +84,16 @@
       return ItemType.hyperlink;
    }
 
+    public Integer getColumn() {
+        return getStartColumn();
+    }
+
+    public Integer getRow() {
+        return getStartRow();
+    }
+
+    public Object getValue() {
+        return getURL();
+    }
+
 }

Modified: trunk/src/excel/org/jboss/seam/excel/ui/UIImage.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UIImage.java	2008-12-11 00:42:44 UTC (rev 9752)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UIImage.java	2008-12-11 07:41:43 UTC (rev 9753)
@@ -73,4 +73,16 @@
       return ItemType.image;
    }
 
+   public Integer getColumn() {
+       return getStartColumn();
+   }
+
+   public Integer getRow() {
+       return getStartRow();
+   }
+
+   public Object getValue() {
+       return getURI();
+   }
+
 }




More information about the seam-commits mailing list