Explorar el Código

Fix corrupted Excel file issue #413

xuri hace 6 años
padre
commit
e7581ebf3e
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      sheet.go

+ 5 - 0
sheet.go

@@ -406,6 +406,11 @@ func (f *File) DeleteSheet(name string) {
 			f.SheetCount--
 		}
 	}
+	for idx, bookView := range wb.BookViews.WorkBookView {
+		if bookView.ActiveTab >= f.SheetCount {
+			wb.BookViews.WorkBookView[idx].ActiveTab--
+		}
+	}
 	f.SetActiveSheet(len(f.GetSheetMap()))
 }