summaryrefslogtreecommitdiff
path: root/styles.go
diff options
context:
space:
mode:
authorRi Xu <xuri.me@gmail.com>2017-09-19 11:59:33 +0800
committerRi Xu <xuri.me@gmail.com>2017-09-19 11:59:33 +0800
commite820388d70da551cacdf3212b559d597a6fdbec8 (patch)
tree4a016dec961ee4b666126696f91438fef21e3851 /styles.go
parentb7b937a8a3e1e92669aaf63d2cc97dc2fc865736 (diff)
Handle coordinate parse exception, relate issue #122.
Diffstat (limited to 'styles.go')
-rw-r--r--styles.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/styles.go b/styles.go
index ee0fbc2..c20bd82 100644
--- a/styles.go
+++ b/styles.go
@@ -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)