From 156bf6d16ecbd5257d81e781138eaaaf357ffbec Mon Sep 17 00:00:00 2001 From: xuri Date: Thu, 27 Jan 2022 22:37:32 +0800 Subject: 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 --- col.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'col.go') 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. -- cgit v1.2.1