summaryrefslogtreecommitdiff
path: root/col.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-07-18 00:21:34 +0800
committerxuri <xuri.me@gmail.com>2022-07-18 00:21:34 +0800
commitebea684ae5c60776d4d8364b7360d0c0603cb3b0 (patch)
tree257562b2549f81ed8593cdd2eaa39ac55652b79a /col.go
parent0d4c97c88aa9254a4db5a0b9192d0f431ff90e43 (diff)
Fix potential file corrupted and change worksheet name case-insensitive
- Using sheet ID instead of sheet index when delete the cell in calculation chain - Update documentation for exported functions - Using `sheet` represent the sheet name in the function parameters
Diffstat (limited to 'col.go')
-rw-r--r--col.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/col.go b/col.go
index ee1a407..95c7961 100644
--- a/col.go
+++ b/col.go
@@ -40,7 +40,15 @@ type Cols struct {
sheetXML []byte
}
-// GetCols return all the columns in a sheet by given worksheet name (case-sensitive). For example:
+// GetCols gets the value of all cells by columns on the worksheet based on the
+// given worksheet name, returned as a two-dimensional array, where the value
+// of the cell is converted to the `string` type. If the cell format can be
+// applied to the value of the cell, the applied value will be used, otherwise
+// the original value will be used.
+//
+// For example, get and traverse the value of all cells by columns on a
+// worksheet named
+// 'Sheet1':
//
// cols, err := f.GetCols("Sheet1")
// if err != nil {
@@ -196,7 +204,7 @@ func columnXMLHandler(colIterator *columnXMLIterator, xmlElement *xml.StartEleme
// }
//
func (f *File) Cols(sheet string) (*Cols, error) {
- name, ok := f.sheetMap[trimSheetName(sheet)]
+ name, ok := f.getSheetXMLPath(sheet)
if !ok {
return nil, ErrSheetNotExist{sheet}
}