[fixed] empty value is^W was returned if cell is string formula

This commit is contained in:
Ivan
2019-04-02 23:38:51 +03:00
parent 5480ee5058
commit 0bc58acfcb
3 changed files with 40 additions and 11 deletions

18
col.go
View File

@@ -54,10 +54,10 @@ func (xf *XfRk) String(wb *WorkBook) string {
fNo := wb.Xfs[idx].formatNo()
if fNo >= 164 { // user defined format
if formatter := wb.Formats[fNo]; formatter != nil {
if (strings.Contains(formatter.str, "#") || strings.Contains(formatter.str, ".00")){
if strings.Contains(formatter.str, "#") || strings.Contains(formatter.str, ".00") {
//If format contains # or .00 then this is a number
return xf.Rk.String()
}else{
return xf.Rk.String()
} else {
i, f, isFloat := xf.Rk.number()
if !isFloat {
f = float64(i)
@@ -165,6 +165,18 @@ func (c *NumberCol) String(wb *WorkBook) []string {
return []string{strconv.FormatFloat(c.Float, 'f', -1, 64)}
}
type FormulaStringCol struct {
Col
RenderedValue string
}
func (c *FormulaStringCol) String(wb *WorkBook) []string {
return []string{c.RenderedValue}
}
//str, err = wb.get_string(buf_item, size)
//wb.sst[offset_pre] = wb.sst[offset_pre] + str
type FormulaCol struct {
Header struct {
Col