summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRi Xu <xuri.me@gmail.com>2017-02-07 14:03:03 +0800
committerRi Xu <xuri.me@gmail.com>2017-02-07 14:03:03 +0800
commit53564cbe57522467a7e0febd0c9ae4374fa90808 (patch)
treef2832e77dbcf13daff10920103d5210661218632
parent94dc0da329a645ed8956e9d688cdc722ddd79f23 (diff)
Fix issue #19.
-rw-r--r--rows.go7
-rw-r--r--test/Workbook1.xlsxbin22958 -> 23055 bytes
-rw-r--r--xmlSharedStrings.go8
3 files changed, 13 insertions, 2 deletions
diff --git a/rows.go b/rows.go
index 4e655b1..89365a2 100644
--- a/rows.go
+++ b/rows.go
@@ -82,6 +82,13 @@ func (xlsx *xlsxC) getValueFrom(f *File) (string, error) {
if err != nil {
return "", err
}
+ if len(d.SI[xlsxSI].R) > 0 {
+ value := ""
+ for _, v := range d.SI[xlsxSI].R {
+ value += v.T
+ }
+ return value, nil
+ }
return d.SI[xlsxSI].T, nil
case "str":
return xlsx.V, nil
diff --git a/test/Workbook1.xlsx b/test/Workbook1.xlsx
index d287361..ee52187 100644
--- a/test/Workbook1.xlsx
+++ b/test/Workbook1.xlsx
Binary files differ
diff --git a/xmlSharedStrings.go b/xmlSharedStrings.go
index 402d3f3..3b9d78a 100644
--- a/xmlSharedStrings.go
+++ b/xmlSharedStrings.go
@@ -3,8 +3,12 @@ package excelize
import "encoding/xml"
// xlsxSST directly maps the sst 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.
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main. String values may
+// be stored directly inside spreadsheet cell elements; however, storing the
+// same value inside multiple cell elements can result in very large worksheet
+// Parts, possibly resulting in performance degradation. The Shared String Table
+// is an indexed list of string values, shared across the workbook, which allows
+// implementations to store values only once.
type xlsxSST struct {
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main sst"`
Count int `xml:"count,attr"`