Merge pull request #141 from WingGao/wing

fix OpenReader no sheet error
This commit is contained in:
xuri 2017-11-03 10:31:48 +08:00 committed by GitHub
commit a4ffb4fbfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -39,8 +39,6 @@ func OpenFile(filename string) (*File, error) {
return nil, err return nil, err
} }
f.Path = filename f.Path = filename
f.sheetMap = f.getSheetMap()
f.Styles = f.stylesReader()
return f, nil return f, nil
} }
@ -60,12 +58,15 @@ func OpenReader(r io.Reader) (*File, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &File{ f := &File{
checked: make(map[string]bool), checked: make(map[string]bool),
Sheet: make(map[string]*xlsxWorksheet), Sheet: make(map[string]*xlsxWorksheet),
SheetCount: sheetCount, SheetCount: sheetCount,
XLSX: file, XLSX: file,
}, nil }
f.sheetMap = f.getSheetMap()
f.Styles = f.stylesReader()
return f, nil
} }
// setDefaultTimeStyle provides function to set default numbers format for // setDefaultTimeStyle provides function to set default numbers format for