未验证 提交 1dbed64f 编写于 作者: E Eagle Xiang 提交者: GitHub

This closes #1269, made the `NewStreamWriter` function case insensitive to worksheet name

Co-authored-by: Nxiangyz <xiangyz@dustess.com>
上级 d74adcbb
......@@ -376,7 +376,7 @@ func (f *File) GetSheetName(index int) (name string) {
// integer type value -1.
func (f *File) getSheetID(name string) int {
for sheetID, sheet := range f.GetSheetMap() {
if sheet == trimSheetName(name) {
if strings.EqualFold(sheet, trimSheetName(name)) {
return sheetID
}
}
......
......@@ -465,6 +465,13 @@ func TestDeleteAndAdjustDefinedNames(t *testing.T) {
deleteAndAdjustDefinedNames(&xlsxWorkbook{}, 0)
}
func TestGetSheetID(t *testing.T) {
file := NewFile()
file.NewSheet("Sheet1")
id := file.getSheetID("sheet1")
assert.NotEqual(t, -1, id)
}
func BenchmarkNewSheet(b *testing.B) {
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册