From 35841caaf18b20af9e7b942ca8cbb7441f310382 Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Mon, 26 Jun 2017 18:44:19 +0800 Subject: - Function `formattedValue()` performance improvement by avoid repeating deserialization, relate issue #64; - Make function `ToAlphaString()` exportable, relate issue #63 --- table.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'table.go') diff --git a/table.go b/table.go index 72f9a9a..5c8325b 100644 --- a/table.go +++ b/table.go @@ -108,12 +108,12 @@ func (f *File) addTable(sheet, tableXML string, hxAxis, hyAxis, vxAxis, vyAxis, vyAxis++ } // Correct table reference coordinate area, such correct C1:B3 to B1:C3. - ref := toAlphaString(hxAxis+1) + strconv.Itoa(hyAxis+1) + ":" + toAlphaString(vxAxis+1) + strconv.Itoa(vyAxis+1) + ref := ToAlphaString(hxAxis+1) + strconv.Itoa(hyAxis+1) + ":" + ToAlphaString(vxAxis+1) + strconv.Itoa(vyAxis+1) tableColumn := []*xlsxTableColumn{} idx := 0 for i := hxAxis; i <= vxAxis; i++ { idx++ - cell := toAlphaString(i+1) + strconv.Itoa(hyAxis+1) + cell := ToAlphaString(i+1) + strconv.Itoa(hyAxis+1) name := f.GetCellValue(sheet, cell) if _, err := strconv.Atoi(name); err == nil { f.SetCellStr(sheet, cell, name) @@ -254,7 +254,7 @@ func (f *File) AutoFilter(sheet, hcell, vcell, format string) error { if vyAxis < hyAxis { vyAxis, hyAxis = hyAxis, vyAxis } - ref := toAlphaString(hxAxis+1) + strconv.Itoa(hyAxis+1) + ":" + toAlphaString(vxAxis+1) + strconv.Itoa(vyAxis+1) + ref := ToAlphaString(hxAxis+1) + strconv.Itoa(hyAxis+1) + ":" + ToAlphaString(vxAxis+1) + strconv.Itoa(vyAxis+1) refRange := vxAxis - hxAxis err := f.autoFilter(sheet, ref, refRange, hxAxis, formatSet) return err -- cgit v1.2.1