From ce7e60f17fb8a79fc24b74dbc51f925801649c55 Mon Sep 17 00:00:00 2001 From: "Andrew C. Oliver" Date: Sun, 23 Jun 2002 14:12:36 +0000 Subject: [PATCH] Fixed the problem with blank cells dirty rendering values git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352717 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hssf/contrib/view/SVTableCellRenderer.java | 6 +++++- .../src/org/apache/poi/hssf/contrib/view/SVTableModel.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java index 20a25010e9..0a09d742da 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java @@ -243,6 +243,8 @@ public class SVTableCellRenderer extends JLabel default: setValue("?"); } + } else { + setValue(""); } @@ -288,7 +290,9 @@ public class SVTableCellRenderer extends JLabel */ private HSSFCell getCell(int row, int col) { HSSFRow r = st.getRow(row); - HSSFCell c = r.getCell((short)col); + HSSFCell c = null; + if ( r != null) + c = r.getCell((short)col); return c; } } diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java index ada60a8400..8ea268bbd5 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java @@ -106,7 +106,7 @@ public class SVTableModel extends AbstractTableModel { } public Class getColumnClass(int c) { - return getValueAt(0, c).getClass(); + return HSSFCell.class; } -- 2.39.5