summaryrefslogtreecommitdiff
path: root/col.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2018-09-27 23:40:00 +0800
committerGitHub <noreply@github.com>2018-09-27 23:40:00 +0800
commit204139739a34aa6e6c5ea8764008276a6d184ff6 (patch)
tree0b9a795ea20804753134fd54c40d17c5a01c64f6 /col.go
parent250946568ca1e5a69c07f19dff4d1d3a2264e31d (diff)
parent3e004d900b103379c2d62657a3070de4a2e8585a (diff)
Merge branch 'master' into master
Diffstat (limited to 'col.go')
-rw-r--r--col.go37
1 files changed, 23 insertions, 14 deletions
diff --git a/col.go b/col.go
index 05ad0cc..32cda12 100644
--- a/col.go
+++ b/col.go
@@ -1,3 +1,12 @@
+// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX files. Support reads and writes XLSX file generated by
+// Microsoft Excelâ„¢ 2007 and later. Support save file without losing original
+// charts of XLSX. This library needs Go version 1.8 or later.
+
package excelize
import (
@@ -121,8 +130,8 @@ func (f *File) SetColOutlineLevel(sheet, column string, level uint8) {
xlsx.Cols.Col = append(xlsx.Cols.Col, col)
}
-// SetColWidth provides function to set the width of a single column or multiple
-// columns. For example:
+// SetColWidth provides a function to set the width of a single column or
+// multiple columns. For example:
//
// xlsx := excelize.NewFile()
// xlsx.SetColWidth("Sheet1", "A", "H", 20)
@@ -259,8 +268,8 @@ func (f *File) positionObjectPixels(sheet string, colStart, rowStart, x1, y1, wi
return colStart, rowStart, xAbs, yAbs, colEnd, rowEnd, x2, y2
}
-// getColWidth provides function to get column width in pixels by given sheet
-// name and column index.
+// getColWidth provides a function to get column width in pixels by given
+// sheet name and column index.
func (f *File) getColWidth(sheet string, col int) int {
xlsx := f.workSheetReader(sheet)
if xlsx.Cols != nil {
@@ -278,8 +287,8 @@ func (f *File) getColWidth(sheet string, col int) int {
return int(defaultColWidthPixels)
}
-// GetColWidth provides function to get column width by given worksheet name and
-// column index.
+// GetColWidth provides a function to get column width by given worksheet name
+// and column index.
func (f *File) GetColWidth(sheet, column string) float64 {
col := TitleToNumber(strings.ToUpper(column)) + 1
xlsx := f.workSheetReader(sheet)
@@ -298,8 +307,8 @@ func (f *File) GetColWidth(sheet, column string) float64 {
return defaultColWidthPixels
}
-// InsertCol provides function to insert a new column before given column index.
-// For example, create a new column before column C in Sheet1:
+// InsertCol provides a function to insert a new column before given column
+// index. For example, create a new column before column C in Sheet1:
//
// xlsx.InsertCol("Sheet1", "C")
//
@@ -308,8 +317,8 @@ func (f *File) InsertCol(sheet, column string) {
f.adjustHelper(sheet, col, -1, 1)
}
-// RemoveCol provides function to remove single column by given worksheet name
-// and column index. For example, remove column C in Sheet1:
+// RemoveCol provides a function to remove single column by given worksheet
+// name and column index. For example, remove column C in Sheet1:
//
// xlsx.RemoveCol("Sheet1", "C")
//
@@ -346,10 +355,10 @@ func completeCol(xlsx *xlsxWorksheet, row, cell int) {
}
}
-// convertColWidthToPixels provieds 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.
+// convertColWidthToPixels provieds 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.
func convertColWidthToPixels(width float64) float64 {
var padding float64 = 5
var pixels float64