aboutsummaryrefslogtreecommitdiffstats
path: root/src/contrib
diff options
context:
space:
mode:
authorJosh Micich <josh@apache.org>2008-09-17 21:54:32 +0000
committerJosh Micich <josh@apache.org>2008-09-17 21:54:32 +0000
commitb3f56e20b2a20a6e7a423c80e6bf94c92e5eb665 (patch)
treeb9fcde3848387f664510145804543bebc4d09ad7 /src/contrib
parentfe820eed5c4aba26347a7d117ffd9f4d052552de (diff)
downloadpoi-b3f56e20b2a20a6e7a423c80e6bf94c92e5eb665.tar.gz
poi-b3f56e20b2a20a6e7a423c80e6bf94c92e5eb665.zip
merged 696075,696084 from trunk - (Fix for bug 45805 - 16-bit signed/unsigned problems in HSSFSheet.getColWidth() etc)
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@696475 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/contrib')
-rw-r--r--src/contrib/src/org/apache/poi/hssf/contrib/view/SViewerPanel.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewerPanel.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewerPanel.java
index c134ffd546..f4695376d0 100644
--- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewerPanel.java
+++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewerPanel.java
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,8 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.contrib.view;
@@ -47,10 +44,10 @@ public class SViewerPanel extends JPanel {
*
*/
private static final int magicCharFactor = 7;
- /** Reference to the woorkbook that is being displayed*/
- private HSSFWorkbook wb;
+ /** Reference to the wookbook that is being displayed*/
+ /* package */ HSSFWorkbook wb;
/** Reference to the tabs component*/
- private JTabbedPane sheetPane;
+ /* package */ JTabbedPane sheetPane;
/** Reference to the cell renderer that is used to render all cells*/
private SVTableCellRenderer cellRenderer;
/** Reference to the cell editor that is used to edit all cells.
@@ -106,7 +103,7 @@ public class SViewerPanel extends JPanel {
TableColumnModel columns = sheetView.getColumnModel();
for (int i=0; i< columns.getColumnCount(); i++) {
TableColumn column = columns.getColumn(i);
- short width = sheet.getColumnWidth((short)i);
+ int width = sheet.getColumnWidth(i);
//256 is because the width is in 256ths of a character
column.setPreferredWidth(width/256*magicCharFactor);
}
@@ -208,7 +205,7 @@ public class SViewerPanel extends JPanel {
public void actionPerformed(ActionEvent e) {
int tabIndex = sheetPane.getSelectedIndex();
if (tabIndex != -1) {
- String newSheetName = (String)JOptionPane.showInputDialog(sheetPane, "Enter a new Sheetname", "Rename Sheet", JOptionPane.QUESTION_MESSAGE);
+ String newSheetName = JOptionPane.showInputDialog(sheetPane, "Enter a new Sheetname", "Rename Sheet", JOptionPane.QUESTION_MESSAGE);
if (newSheetName != null) {
wb.setSheetName(tabIndex, newSheetName);
sheetPane.setTitleAt(tabIndex, newSheetName);