Skip to content

Commit

Permalink
- Fix DeleteSheet() make broken file, relate issue qax-os#165;
Browse files Browse the repository at this point in the history
- godoc updated
  • Loading branch information
xuri committed Dec 4, 2017
1 parent 6d634ca commit 749d12e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sheet.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ func replaceRelationshipsNameSpace(workbookMarshal string) string {
return strings.Replace(workbookMarshal, oldXmlns, newXmlns, -1)
}

// SetActiveSheet provides function to set default active sheet of XLSX by given
// index.
// SetActiveSheet provides function to set default active worksheet of XLSX by
// given index. Note that active index is different with the index that got by
// function GetSheetMap, and it should be greater than 0 and less than total
// worksheet numbers.
func (f *File) SetActiveSheet(index int) {
if index < 1 {
index = 1
Expand Down Expand Up @@ -227,7 +229,6 @@ func (f *File) SetActiveSheet(index int) {
}
}
}
return
}

// GetActiveSheetIndex provides function to get active sheet of XLSX. If not
Expand Down Expand Up @@ -385,6 +386,7 @@ func (f *File) DeleteSheet(name string) {
f.SheetCount--
}
}
f.SetActiveSheet(len(f.GetSheetMap()))
}

// deleteSheetFromWorkbookRels provides function to remove worksheet
Expand Down

0 comments on commit 749d12e

Please sign in to comment.