diff options
author | xuri <xuri.me@gmail.com> | 2022-07-18 00:21:34 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-07-18 00:21:34 +0800 |
commit | ebea684ae5c60776d4d8364b7360d0c0603cb3b0 (patch) | |
tree | 257562b2549f81ed8593cdd2eaa39ac55652b79a /rows.go | |
parent | 0d4c97c88aa9254a4db5a0b9192d0f431ff90e43 (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 'rows.go')
-rw-r--r-- | rows.go | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -26,13 +26,16 @@ import ( "github.com/mohae/deepcopy" ) -// GetRows return all the rows in a sheet by given worksheet name -// (case sensitive), 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. GetRows fetched the rows with value or formula -// cells, the continually blank cells in the tail of each row will be skipped, -// so the length of each row may be inconsistent. For example: +// GetRows return all the rows in a sheet by 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. +// GetRows fetched the rows with value or formula cells, the continually blank +// cells in the tail of each row will be skipped, so the length of each row +// may be inconsistent. +// +// For example, get and traverse the value of all cells by rows on a worksheet +// named 'Sheet1': // // rows, err := f.GetRows("Sheet1") // if err != nil { @@ -233,7 +236,7 @@ func (rows *Rows) rowXMLHandler(rowIterator *rowXMLIterator, xmlElement *xml.Sta // } // func (f *File) Rows(sheet string) (*Rows, error) { - name, ok := f.sheetMap[trimSheetName(sheet)] + name, ok := f.getSheetXMLPath(sheet) if !ok { return nil, ErrSheetNotExist{sheet} } |