summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--excelize.go2
-rw-r--r--picture.go6
-rw-r--r--styles.go4
-rw-r--r--table.go2
4 files changed, 6 insertions, 8 deletions
diff --git a/excelize.go b/excelize.go
index fa9c004..39c2fad 100644
--- a/excelize.go
+++ b/excelize.go
@@ -210,7 +210,7 @@ func (f *File) SetCellDefault(sheet, axis, value string) {
}
// Completion column element tags of XML in a sheet.
-func completeCol(xlsx *xlsxWorksheet, row int, cell int) {
+func completeCol(xlsx *xlsxWorksheet, row, cell int) {
if len(xlsx.SheetData.Row) < cell {
for i := len(xlsx.SheetData.Row); i < cell; i++ {
xlsx.SheetData.Row = append(xlsx.SheetData.Row, xlsxRow{
diff --git a/picture.go b/picture.go
index db731e4..a61c1e2 100644
--- a/picture.go
+++ b/picture.go
@@ -218,7 +218,7 @@ func (f *File) addDrawingPicture(sheet, drawingXML, cell, file string, width, he
// addDrawingRelationships provides function to add image part relationships in
// the file xl/drawings/_rels/drawing%d.xml.rels by given drawing index,
// relationship type and target.
-func (f *File) addDrawingRelationships(index int, relType string, target string) int {
+func (f *File) addDrawingRelationships(index int, relType, target string) int {
var rels = "xl/drawings/_rels/drawing" + strconv.Itoa(index) + ".xml.rels"
var drawingRels xlsxWorkbookRels
var rID = 1
@@ -257,7 +257,7 @@ func (f *File) countMedia() int {
// addMedia provides function to add picture into folder xl/media/image by given
// file name and extension name.
-func (f *File) addMedia(file string, ext string) {
+func (f *File) addMedia(file, ext string) {
count := f.countMedia()
dat, _ := ioutil.ReadFile(file)
media := "xl/media/image" + strconv.Itoa(count+1) + ext
@@ -341,7 +341,7 @@ func (f *File) addContentTypePart(index int, contentType string) {
// getSheetRelationshipsTargetByID provides function to get Target attribute
// value in xl/worksheets/_rels/sheet%d.xml.rels by given sheet name and
// relationship index.
-func (f *File) getSheetRelationshipsTargetByID(sheet string, rID string) string {
+func (f *File) getSheetRelationshipsTargetByID(sheet, rID string) string {
var rels = "xl/worksheets/_rels/" + strings.ToLower(sheet) + ".xml.rels"
var sheetRels xlsxWorkbookRels
xml.Unmarshal([]byte(f.readXML(rels)), &sheetRels)
diff --git a/styles.go b/styles.go
index cc57e36..2c4c5af 100644
--- a/styles.go
+++ b/styles.go
@@ -776,8 +776,8 @@ func (f *File) setCellStyle(sheet, hcell, vcell string, styleID int) {
xlsx := f.workSheetReader(sheet)
- completeRow(xlsx, vxAxis+1, vyAxis+1)
- completeCol(xlsx, vxAxis+1, vyAxis+1)
+ completeRow(xlsx, vyAxis+1, vxAxis+1)
+ completeCol(xlsx, vyAxis+1, vxAxis+1)
for r, row := range xlsx.SheetData.Row {
for k, c := range row.C {
diff --git a/table.go b/table.go
index 13b1edf..de9b4aa 100644
--- a/table.go
+++ b/table.go
@@ -236,12 +236,10 @@ func (f *File) AutoFilter(sheet, hcell, vcell, format string) error {
vxAxis := titleToNumber(vcol)
if vxAxis < hxAxis {
- hcell, vcell = vcell, hcell
vxAxis, hxAxis = hxAxis, vxAxis
}
if vyAxis < hyAxis {
- hcell, vcell = vcell, hcell
vyAxis, hyAxis = hyAxis, vyAxis
}
ref := toAlphaString(hxAxis+1) + strconv.Itoa(hyAxis+1) + ":" + toAlphaString(vxAxis+1) + strconv.Itoa(vyAxis+1)