summaryrefslogtreecommitdiff
path: root/styles.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2018-01-19 20:58:26 +0800
committerGitHub <noreply@github.com>2018-01-19 20:58:26 +0800
commit541d29f3b2bfc62c05813a8d8725fca0a628bc81 (patch)
tree0942444e882e0f6db2aee1092150bcdb75448b85 /styles.go
parent50cdaed5a36f7112c2ff01504c475457f0d4944e (diff)
parent317ef65381b179b863dcd6b1f5479cc576a8376c (diff)
Merge pull request #180 from mbresson/optimize-SetCellStyle
make SetCellStyle quicker by skipping conversions in checkCellInArea,…
Diffstat (limited to 'styles.go')
-rw-r--r--styles.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/styles.go b/styles.go
index 87bca13..8cee5ff 100644
--- a/styles.go
+++ b/styles.go
@@ -2327,7 +2327,19 @@ func (f *File) SetCellStyle(sheet, hcell, vcell string, styleID int) {
completeCol(xlsx, vyAxis+1, vxAxis+1)
for r, row := range xlsx.SheetData.Row {
+ if r < hyAxis {
+ continue
+ } else if r > vyAxis {
+ break
+ }
+
for k, c := range row.C {
+ if k < hxAxis {
+ continue
+ } else if k > vxAxis {
+ break
+ }
+
if checkCellInArea(c.R, hcell+":"+vcell) {
xlsx.SheetData.Row[r].C[k].S = styleID
}