summaryrefslogtreecommitdiff
path: root/sheet.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-03-22 10:39:08 +0800
committerGitHub <noreply@github.com>2021-03-22 10:39:08 +0800
commitbd83c27ffc11915d0f6ffaa904ed999364434792 (patch)
tree6e8da54091b44706e34b70173cf9a504cbaa971a /sheet.go
parent874d59cee02b5fab36e7cf5e2595c473f65f6c9d (diff)
parentd08a6d243761a6214f8fef3181b689251bb72de0 (diff)
Merge pull request #808 from JDavidVR/patch-1
updated SetDefinedName's localSheetId attr to use sheetIndex
Diffstat (limited to 'sheet.go')
-rw-r--r--sheet.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/sheet.go b/sheet.go
index 0873644..5a9fd46 100644
--- a/sheet.go
+++ b/sheet.go
@@ -1487,9 +1487,8 @@ func (f *File) SetDefinedName(definedName *DefinedName) error {
Data: definedName.RefersTo,
}
if definedName.Scope != "" {
- if sheetID := f.getSheetID(definedName.Scope); sheetID != 0 {
- sheetID--
- d.LocalSheetID = &sheetID
+ if sheetIndex := f.GetSheetIndex(definedName.Scope); sheetIndex >= 0 {
+ d.LocalSheetID = &sheetIndex
}
}
if wb.DefinedNames != nil {