summaryrefslogtreecommitdiff
path: root/col.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-01-27 22:37:32 +0800
committerxuri <xuri.me@gmail.com>2022-01-27 22:37:32 +0800
commit156bf6d16ecbd5257d81e781138eaaaf357ffbec (patch)
tree1f0e630121f6368e004734f176f6d1549988f176 /col.go
parent3ee3c38f9c63de3782fad21aae9c05ee0530fc32 (diff)
This closes #1129, make cell support inheritance columns/rows style
Correct cells style in merge range Fix incorrect style ID returned on getting cell style in some cases Unit test updated and simplified code
Diffstat (limited to 'col.go')
-rw-r--r--col.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/col.go b/col.go
index a496e88..16d1f93 100644
--- a/col.go
+++ b/col.go
@@ -592,9 +592,8 @@ func (f *File) positionObjectPixels(sheet string, col, row, x1, y1, width, heigh
row++
}
- // Initialise end cell to the same as the start cell.
- colEnd := col
- rowEnd := row
+ // Initialized end cell to the same as the start cell.
+ colEnd, rowEnd := col, row
width += x1
height += y1
@@ -632,7 +631,7 @@ func (f *File) getColWidth(sheet string, col int) int {
return int(convertColWidthToPixels(width))
}
}
- // Optimisation for when the column widths haven't changed.
+ // Optimization for when the column widths haven't changed.
return int(defaultColWidthPixels)
}
@@ -658,7 +657,7 @@ func (f *File) GetColWidth(sheet, col string) (float64, error) {
return width, err
}
}
- // Optimisation for when the column widths haven't changed.
+ // Optimization for when the column widths haven't changed.
return defaultColWidth, err
}
@@ -707,7 +706,7 @@ func (f *File) RemoveCol(sheet, col string) error {
return f.adjustHelper(sheet, columns, num, -1)
}
-// convertColWidthToPixels provieds function to convert the width of a cell
+// convertColWidthToPixels provides function to convert the width of a cell
// from user's units to pixels. Excel rounds the column width to the nearest
// pixel. If the width hasn't been set by the user we use the default value.
// If the column is hidden it has a value of zero.