summaryrefslogtreecommitdiff
path: root/cell.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-10-26 00:04:23 +0800
committerxuri <xuri.me@gmail.com>2022-10-26 00:04:23 +0800
commitadf9d37d82edd3dbc365fece76a031a92e2220d6 (patch)
tree9cabfbaab8fb790c65591b7e0d8c7fde4c6a72eb /cell.go
parentf44153ea4679247070d6f1e31bb0934a10bebb31 (diff)
This closes #1379, cleanup stream writer temporary files by the `Close` function
- Fix error on inserting columns or rows on the worksheet which contains one cell merged cell range - Fix getting incomplete rich text cell value in some cases - Unit tests updated
Diffstat (limited to 'cell.go')
-rw-r--r--cell.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/cell.go b/cell.go
index 6ed7f48..fbc84b7 100644
--- a/cell.go
+++ b/cell.go
@@ -152,19 +152,19 @@ func (f *File) SetCellValue(sheet, cell string, value interface{}) error {
// String extracts characters from a string item.
func (x xlsxSI) String() string {
- if len(x.R) > 0 {
- var rows strings.Builder
- for _, s := range x.R {
- if s.T != nil {
- rows.WriteString(s.T.Val)
- }
+ var value strings.Builder
+ if x.T != nil {
+ value.WriteString(x.T.Val)
+ }
+ for _, s := range x.R {
+ if s.T != nil {
+ value.WriteString(s.T.Val)
}
- return bstrUnmarshal(rows.String())
}
- if x.T != nil {
- return bstrUnmarshal(x.T.Val)
+ if value.Len() == 0 {
+ return ""
}
- return ""
+ return bstrUnmarshal(value.String())
}
// hasValue determine if cell non-blank value.