summaryrefslogtreecommitdiff
path: root/rows.go
diff options
context:
space:
mode:
Diffstat (limited to 'rows.go')
-rw-r--r--rows.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/rows.go b/rows.go
index 3796441..e12e349 100644
--- a/rows.go
+++ b/rows.go
@@ -10,9 +10,11 @@
package excelize
import (
- "encoding/xml"
+ "bytes"
"errors"
"fmt"
+ "io"
+ "log"
"math"
"strconv"
)
@@ -187,15 +189,21 @@ func (f *File) GetRowHeight(sheet string, row int) (float64, error) {
// sharedStringsReader provides a function to get the pointer to the structure
// after deserialization of xl/sharedStrings.xml.
func (f *File) sharedStringsReader() *xlsxSST {
+ var err error
+
if f.SharedStrings == nil {
var sharedStrings xlsxSST
ss := f.readXML("xl/sharedStrings.xml")
if len(ss) == 0 {
ss = f.readXML("xl/SharedStrings.xml")
}
- _ = xml.Unmarshal(namespaceStrictToTransitional(ss), &sharedStrings)
+ if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(ss))).
+ Decode(&sharedStrings); err != nil && err != io.EOF {
+ log.Printf("xml decode error: %s", err)
+ }
f.SharedStrings = &sharedStrings
}
+
return f.SharedStrings
}