mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
修复问题 more than 3 if/for/while/switch/try
This commit is contained in:
parent
b32865ad65
commit
b923783b34
@ -744,7 +744,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
* @param cellStyle 合并后单元格使用的样式,可以为null
|
* @param cellStyle 合并后单元格使用的样式,可以为null
|
||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public ExcelWriter merge(int firstRow, int lastRow, int firstColumn, int lastColumn, Object content, CellStyle cellStyle){
|
public ExcelWriter merge(int firstRow, int lastRow, int firstColumn, int lastColumn, Object content, CellStyle cellStyle) {
|
||||||
Assert.isFalse(this.isClosed, "ExcelWriter has been closed!");
|
Assert.isFalse(this.isClosed, "ExcelWriter has been closed!");
|
||||||
|
|
||||||
CellUtil.mergingCells(this.getSheet(), firstRow, lastRow, firstColumn, lastColumn, cellStyle);
|
CellUtil.mergingCells(this.getSheet(), firstRow, lastRow, firstColumn, lastColumn, cellStyle);
|
||||||
@ -883,16 +883,17 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
public ExcelWriter writeSecHeadRow(Iterable<?> rowData){
|
public ExcelWriter writeSecHeadRow(Iterable<?> rowData){
|
||||||
final Row row = RowUtil.getOrCreateRow(this.sheet,this.currentRow.getAndIncrement());
|
final Row row = RowUtil.getOrCreateRow(this.sheet,this.currentRow.getAndIncrement());
|
||||||
Iterator<?> iterator = rowData.iterator();
|
Iterator<?> iterator = rowData.iterator();
|
||||||
if (row.getLastCellNum() != 0){
|
if (row.getLastCellNum() != 0) {
|
||||||
for (int i = 0; i < this.workbook.getSpreadsheetVersion().getMaxColumns(); i++) {
|
for (int i = 0; i < this.workbook.getSpreadsheetVersion().getMaxColumns(); i++) {
|
||||||
Cell cell = row.getCell(i);
|
Cell cell = row.getCell(i);
|
||||||
if (cell == null) {
|
if (cell != null) {
|
||||||
if(iterator.hasNext()){
|
continue;
|
||||||
cell = row.createCell(i);
|
}
|
||||||
CellUtil.setCellValue(cell, iterator.next(), this.styleSet, true);
|
if (iterator.hasNext()) {
|
||||||
}else{
|
cell = row.createCell(i);
|
||||||
break;
|
CellUtil.setCellValue(cell, iterator.next(), this.styleSet, true);
|
||||||
}
|
} else {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user