View | Details | Raw Unified | Return to bug 46092
Collapse All | Expand All

(-)HSSF.java (-10 / +14 lines)
Lines 221-227 Link Here
221
        if (args.length < 2)
221
        if (args.length < 2)
222
        {
222
        {
223
223
224
/*            try
224
            try
225
            {
225
            {
226
                HSSF hssf = new HSSF(args[ 0 ]);
226
                HSSF hssf = new HSSF(args[ 0 ]);
227
227
Lines 230-255 Link Here
230
230
231
                for (int k = 0; k < wb.getNumberOfSheets(); k++)
231
                for (int k = 0; k < wb.getNumberOfSheets(); k++)
232
                {
232
                {
233
                    System.out.println("Sheet " + k);
234
                    HSSFSheet sheet = wb.getSheetAt(k);
233
                    HSSFSheet sheet = wb.getSheetAt(k);
235
                    int       rows  = sheet.getPhysicalNumberOfRows();
234
                    int       rows  = sheet.getPhysicalNumberOfRows();
236
235
                    System.out.println("Sheet " + k + " \""
236
                                       + wb.getSheetName(k) + "\" has "
237
                                       + rows + " row(s).");
237
                    for (int r = 0; r < rows; r++)
238
                    for (int r = 0; r < rows; r++)
238
                    {
239
                    {
239
                        HSSFRow row   = sheet.getPhysicalRowAt(r);
240
                        HSSFRow row   = sheet.getRow(r);
240
                        int     cells = row.getPhysicalNumberOfCells();
241
                        int     cells = (row != null) ? row.getPhysicalNumberOfCells() : 0;
241
242
                        if (row != null) {
242
                        System.out.println("ROW " + row.getRowNum());
243
                          System.out.println("\nROW " + row.getRowNum()
244
                                             + " has " + cells + " cell(s).");
245
                        }
243
                        for (int c = 0; c < cells; c++)
246
                        for (int c = 0; c < cells; c++)
244
                        {
247
                        {
245
                            HSSFCell cell  = row.getPhysicalCellAt(c);
248
                            HSSFCell cell  = row.getCell(c);
246
                            String   value = null;
249
                            String   value = null;
247
250
248
                            switch (cell.getCellType())
251
                            switch (cell.getCellType())
249
                            {
252
                            {
250
253
251
                                case HSSFCell.CELL_TYPE_FORMULA :
254
                                case HSSFCell.CELL_TYPE_FORMULA :
252
                                    value = "FORMULA ";
255
                                    value = "FORMULA value="
256
                                    + cell.getCellFormula();
253
                                    break;
257
                                    break;
254
258
255
                                case HSSFCell.CELL_TYPE_NUMERIC :
259
                                case HSSFCell.CELL_TYPE_NUMERIC :
Lines 274-280 Link Here
274
            catch (Exception e)
278
            catch (Exception e)
275
            {
279
            {
276
                e.printStackTrace();
280
                e.printStackTrace();
277
            }*/
281
            }
278
        }
282
        }
279
        else if (args.length == 2)
283
        else if (args.length == 2)
280
        {
284
        {

Return to bug 46092