From a2d449708cf72928394b4bc4aea41c0c6a606fa2 Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 22 Aug 2021 13:36:56 +0800 Subject: - This fix panic and incorrect cell read on some case - Make unit test on Go 1.7 - API documentation updated --- rows.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'rows.go') diff --git a/rows.go b/rows.go index fb03bba..bfd7d13 100644 --- a/rows.go +++ b/rows.go @@ -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: // -- cgit v1.2.1