summaryrefslogtreecommitdiff
path: root/sheet.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-10-19 23:55:54 +0800
committerxuri <xuri.me@gmail.com>2020-10-19 23:55:54 +0800
commit4834a058aa3f953a7010704f2358633ae6e1d492 (patch)
tree08fa4cd30047ebee2a6f5e84a0ac8ea2796e27f3 /sheet.go
parent520aa679f34bafbc00626151075b0b123eceb516 (diff)
This closes #714 and closes #715, fix wrong worksheet index returned by NewSheet in some case, fix panic on formatted value with no built-in number format ID
Diffstat (limited to 'sheet.go')
-rw-r--r--sheet.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/sheet.go b/sheet.go
index aaa72cc..44067fe 100644
--- a/sheet.go
+++ b/sheet.go
@@ -37,8 +37,9 @@ import (
// appending the new sheet.
func (f *File) NewSheet(name string) int {
// Check if the worksheet already exists
- if f.GetSheetIndex(name) != -1 {
- return f.SheetCount
+ index := f.GetSheetIndex(name)
+ if index != -1 {
+ return index
}
f.DeleteSheet(name)
f.SheetCount++