diff options
author | xuri <xuri.me@gmail.com> | 2021-08-22 13:36:56 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-08-22 13:36:56 +0800 |
commit | a2d449708cf72928394b4bc4aea41c0c6a606fa2 (patch) | |
tree | 3107f4d43971e0c10c7946a7644c2d3b3626cd2b /rows.go | |
parent | 9b55f4f9f0b839934eb8113d2092c60a1a5b64b8 (diff) |
- This fix panic and incorrect cell read on some case
- Make unit test on Go 1.7
- API documentation updated
Diffstat (limited to 'rows.go')
-rw-r--r-- | rows.go | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -24,8 +24,12 @@ import ( ) // GetRows return all the rows in a sheet by given worksheet name -// (case sensitive). GetRows fetched the rows with value or formula cells, -// the tail continuously empty cell will be skipped. For example: +// (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 tail continuously empty cell will be skipped. +// For example: // // rows, err := f.GetRows("Sheet1") // if err != nil { @@ -111,7 +115,7 @@ func (rows *Rows) Columns() ([]string, error) { } case xml.EndElement: rowIterator.inElement = xmlElement.Name.Local - if rowIterator.row == 0 { + if rowIterator.row == 0 && rowIterator.rows.curRow > 1 { rowIterator.row = rowIterator.rows.curRow } if rowIterator.inElement == "row" && rowIterator.row+1 < rowIterator.rows.curRow { @@ -720,9 +724,9 @@ func checkRow(ws *xlsxWorksheet) error { return nil } -// SetRowStyle provides a function to set style of rows by given worksheet -// name, row range and style ID. Note that this will overwrite the existing -// styles for the cell, it won't append or merge style with existing styles. +// SetRowStyle provides a function to set the style of rows by given worksheet +// name, row range, and style ID. Note that this will overwrite the existing +// styles for the rows, it won't append or merge style with existing styles. // // For example set style of row 1 on Sheet1: // |