summaryrefslogtreecommitdiff
path: root/styles.go
diff options
context:
space:
mode:
authorRi Xu <xuri.me@gmail.com>2017-06-27 17:53:06 +0800
committerRi Xu <xuri.me@gmail.com>2017-06-27 17:53:06 +0800
commit555e2ba9a82d6974077681c7ab34ce0fa93d351d (patch)
tree6d1d5ba963d1f2fc1cebebd61833e6b135ae8cc8 /styles.go
parent35841caaf18b20af9e7b942ca8cbb7441f310382 (diff)
- Make function `TitleToNumber()` exportable, note that function `ToAlphaString()` return value calculation changes, get more info from go doc. Relate issue #63;
- Readme and go doc updated
Diffstat (limited to 'styles.go')
-rw-r--r--styles.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/styles.go b/styles.go
index 04774c2..6db97c1 100644
--- a/styles.go
+++ b/styles.go
@@ -767,12 +767,12 @@ func (f *File) setCellStyle(sheet, hcell, vcell string, styleID int) {
hcol := string(strings.Map(letterOnlyMapF, hcell))
hrow, _ := strconv.Atoi(strings.Map(intOnlyMapF, hcell))
hyAxis := hrow - 1
- hxAxis := titleToNumber(hcol)
+ hxAxis := TitleToNumber(hcol)
vcol := string(strings.Map(letterOnlyMapF, vcell))
vrow, _ := strconv.Atoi(strings.Map(intOnlyMapF, vcell))
vyAxis := vrow - 1
- vxAxis := titleToNumber(vcol)
+ vxAxis := TitleToNumber(vcol)
if vxAxis < hxAxis {
hcell, vcell = vcell, hcell
@@ -785,8 +785,8 @@ func (f *File) setCellStyle(sheet, hcell, vcell string, styleID int) {
}
// Correct the coordinate area, such correct C1:B3 to B1:C3.
- hcell = ToAlphaString(hxAxis+1) + strconv.Itoa(hyAxis+1)
- vcell = ToAlphaString(vxAxis+1) + strconv.Itoa(vyAxis+1)
+ hcell = ToAlphaString(hxAxis) + strconv.Itoa(hyAxis+1)
+ vcell = ToAlphaString(vxAxis) + strconv.Itoa(vyAxis+1)
xlsx := f.workSheetReader(sheet)