summaryrefslogtreecommitdiff
path: root/sheet.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-11-12 00:02:11 +0800
committerxuri <xuri.me@gmail.com>2022-11-12 00:16:23 +0800
commitbd5dd17673f767b9f4643423c77eec486f2ad53f (patch)
treed1ceaf5f7eeff101bcf5b3f9a861a8b115088718 /sheet.go
parent58b5dae5eb4948a3cde238ced1ae05db159749f5 (diff)
This is a breaking change, remove partial internal error log print, throw XML deserialize error
- Add error return value for the `GetComments`, `GetDefaultFont` and `SetDefaultFont` functions - Update unit tests
Diffstat (limited to 'sheet.go')
-rw-r--r--sheet.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/sheet.go b/sheet.go
index 1346801..0616d95 100644
--- a/sheet.go
+++ b/sheet.go
@@ -881,10 +881,12 @@ func (f *File) searchSheet(name, value string, regSearch bool) (result []string,
var (
cellName, inElement string
cellCol, row int
- d *xlsxSST
+ sst *xlsxSST
)
- d = f.sharedStringsReader()
+ if sst, err = f.sharedStringsReader(); err != nil {
+ return
+ }
decoder := f.xmlNewDecoder(bytes.NewReader(f.readBytes(name)))
for {
var token xml.Token
@@ -907,7 +909,7 @@ func (f *File) searchSheet(name, value string, regSearch bool) (result []string,
if inElement == "c" {
colCell := xlsxC{}
_ = decoder.DecodeElement(&colCell, &xmlElement)
- val, _ := colCell.getValueFrom(f, d, false)
+ val, _ := colCell.getValueFrom(f, sst, false)
if regSearch {
regex := regexp.MustCompile(value)
if !regex.MatchString(val) {