Ver Fonte

Merge branch '8.3' into debug

Roc há 2 anos atrás
pai
commit
ed28cddd43
1 ficheiros alterados com 5 adições e 0 exclusões
  1. 5 0
      services/excel/lucky_sheet.go

+ 5 - 0
services/excel/lucky_sheet.go

@@ -659,6 +659,11 @@ func HandleTableCell(oldTableData TableData) (newTableData TableData) {
 				continue
 			}
 			tmpColumnDataList := newTableData.TableDataList[rowIndex]
+
+			// 最后一列合并单元格时,就不再次移除合并的单元格,避免数组越界
+			if columnIndex >= len(tmpColumnDataList) {
+				continue
+			}
 			newTableData.TableDataList[rowIndex] = append(tmpColumnDataList[:columnIndex], tmpColumnDataList[columnIndex+1:]...) // 删除开头N个元素
 			//fmt.Println("row:", rowIndex, "===column:", columnIndex)
 		}