summaryrefslogtreecommitdiff
path: root/xmlSharedStrings.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-08-11 00:12:58 +0800
committerGitHub <noreply@github.com>2019-08-11 00:12:58 +0800
commitadc4aed472601440c0dced25b1378cb090829419 (patch)
tree360592fa00a21513efcf78ebdf09062c7f08d54d /xmlSharedStrings.go
parent23c8d1ec8a1d22f6dbec3bde4bad938fecadcc7e (diff)
parentacd76425c2ee55c45a51cf7f71c8a6187a09f507 (diff)
Merge pull request #464 from mlh758/fix-462
Fixed #462 Handle multi row inline strings
Diffstat (limited to 'xmlSharedStrings.go')
-rw-r--r--xmlSharedStrings.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/xmlSharedStrings.go b/xmlSharedStrings.go
index 3fcf3d5..48d4464 100644
--- a/xmlSharedStrings.go
+++ b/xmlSharedStrings.go
@@ -9,7 +9,10 @@
package excelize
-import "encoding/xml"
+import (
+ "encoding/xml"
+ "strings"
+)
// xlsxSST directly maps the sst element from the namespace
// http://schemas.openxmlformats.org/spreadsheetml/2006/main. String values may
@@ -33,6 +36,17 @@ type xlsxSI struct {
R []xlsxR `xml:"r"`
}
+func (x xlsxSI) String() string {
+ if len(x.R) > 0 {
+ var rows strings.Builder
+ for _, s := range x.R {
+ rows.WriteString(s.T)
+ }
+ return rows.String()
+ }
+ return x.T
+}
+
// xlsxR directly maps the r element from the namespace
// http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
// not checked this for completeness - it does as much as I need.