From 30549c5e90884789fff6599d6e773d1ca56ba962 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 8 Feb 2021 18:05:15 +0800 Subject: fix custom row height check issue --- sheet.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sheet.go') diff --git a/sheet.go b/sheet.go index bb94f6a..0d6f5d1 100644 --- a/sheet.go +++ b/sheet.go @@ -860,18 +860,18 @@ func (f *File) searchSheet(name, value string, regSearch bool) (result []string, } break } - switch startElement := token.(type) { + switch xmlElement := token.(type) { case xml.StartElement: - inElement = startElement.Name.Local + inElement = xmlElement.Name.Local if inElement == "row" { - row, err = attrValToInt("r", startElement.Attr) + row, err = attrValToInt("r", xmlElement.Attr) if err != nil { return } } if inElement == "c" { colCell := xlsxC{} - _ = decoder.DecodeElement(&colCell, &startElement) + _ = decoder.DecodeElement(&colCell, &xmlElement) val, _ := colCell.getValueFrom(f, d) if regSearch { regex := regexp.MustCompile(value) @@ -1745,7 +1745,7 @@ func prepareSheetXML(ws *xlsxWorksheet, col int, row int) { sizeHint := 0 var ht float64 var customHeight bool - if ws.SheetFormatPr != nil { + if ws.SheetFormatPr != nil && ws.SheetFormatPr.CustomHeight { ht = ws.SheetFormatPr.DefaultRowHeight customHeight = true } -- cgit v1.2.1