diff options
author | Ri Xu <xuri.me@gmail.com> | 2017-09-19 11:59:33 +0800 |
---|---|---|
committer | Ri Xu <xuri.me@gmail.com> | 2017-09-19 11:59:33 +0800 |
commit | e820388d70da551cacdf3212b559d597a6fdbec8 (patch) | |
tree | 4a016dec961ee4b666126696f91438fef21e3851 /styles.go | |
parent | b7b937a8a3e1e92669aaf63d2cc97dc2fc865736 (diff) |
Handle coordinate parse exception, relate issue #122.
Diffstat (limited to 'styles.go')
-rw-r--r-- | styles.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -2279,12 +2279,18 @@ func (f *File) SetCellStyle(sheet, hcell, vcell string, styleID int) { // Coordinate conversion, convert C1:B3 to 2,0,1,2. hcol := string(strings.Map(letterOnlyMapF, hcell)) - hrow, _ := strconv.Atoi(strings.Map(intOnlyMapF, hcell)) + hrow, err := strconv.Atoi(strings.Map(intOnlyMapF, hcell)) + if err != nil { + return + } hyAxis := hrow - 1 hxAxis := TitleToNumber(hcol) vcol := string(strings.Map(letterOnlyMapF, vcell)) - vrow, _ := strconv.Atoi(strings.Map(intOnlyMapF, vcell)) + vrow, err := strconv.Atoi(strings.Map(intOnlyMapF, vcell)) + if err != nil { + return + } vyAxis := vrow - 1 vxAxis := TitleToNumber(vcol) |