Merge pull request #808 from JDavidVR/patch-1

updated SetDefinedName's localSheetId attr to use sheetIndex
This commit is contained in:
xuri 2021-03-22 10:39:08 +08:00 committed by GitHub
commit bd83c27ffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -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 {