Changeset 7671
- Timestamp:
- Mar 21, 2019, 1:35:39 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/util/excel/XlsxToCsvUtil.java
r7664 r7671 362 362 if (row == null || row.getPhysicalNumberOfCells() == 0) continue; // Empty row -- skip it 363 363 minCol = Math.min(minCol, row.getFirstCellNum()); 364 maxCol = Math.max(maxCol, row.getLastCellNum()); // Note! getLastCellNum() returns index of last cell+1 that contains data!364 int maxRowCol = row.getLastCellNum(); // Note! getLastCellNum() returns index of last cell+1 that contains data! 365 365 366 366 // Sometimes there are a lot of empty or otherwise unused cells to the right on each row... … … 369 369 do 370 370 { 371 max Col--;372 if (max Col < 0) break;373 Cell c = row.getCell(max Col);371 maxRowCol--; 372 if (maxRowCol < 0) break; 373 Cell c = row.getCell(maxRowCol); 374 374 cellType = c == null ? CellType.BLANK : c.getCellType(); 375 375 if (cellType == CellType.FORMULA && evaluateFormulas) … … 380 380 381 381 // Ok, found data on this row 382 if (maxCol >= 0) lastRowWithData = rowNo; 382 if (maxRowCol >= 0) lastRowWithData = rowNo; 383 maxCol = Math.max(maxCol, maxRowCol); 383 384 } 384 385 this.lastRow = lastRowWithData; … … 586 587 } 587 588 out.append(rowSeparator); 588 } 589 589 } 590 590 csvBytes = out.toString().getBytes(charset); 591 591 }
Note: See TracChangeset
for help on using the changeset viewer.