summaryrefslogtreecommitdiff
path: root/sheet.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-02-08 18:05:15 +0800
committerxuri <xuri.me@gmail.com>2021-02-08 18:05:15 +0800
commit30549c5e90884789fff6599d6e773d1ca56ba962 (patch)
treef8df8c92279358fc6e3cd5ed8573bbaa794f0162 /sheet.go
parent2fb135bc94bbb0c487563d166fd24786fab7280a (diff)
fix custom row height check issue
Diffstat (limited to 'sheet.go')
-rw-r--r--sheet.go10
1 files changed, 5 insertions, 5 deletions
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
}