Skip to content

Commit

Permalink
Golang 1.9 compatible, fix issue qax-os#111
Browse files Browse the repository at this point in the history
  • Loading branch information
xuri committed Sep 1, 2017
1 parent 1ec2661 commit 574a6b2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
13 changes: 2 additions & 11 deletions cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,8 @@ func (f *File) GetCellValue(sheet, axis string) string {
if axis != r.R {
continue
}
switch r.T {
case "s":
shardStrings := f.sharedStringsReader()
xlsxSI := 0
xlsxSI, _ = strconv.Atoi(r.V)
return f.formattedValue(r.S, shardStrings.SI[xlsxSI].T)
case "str":
return f.formattedValue(r.S, r.V)
default:
return f.formattedValue(r.S, r.V)
}
val, _ := r.getValueFrom(f, f.sharedStringsReader())
return val
}
}
return ""
Expand Down
4 changes: 2 additions & 2 deletions comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (f *File) addComment(commentsXML, cell string, formatSet *formatComment) {
{
RPr: &xlsxRPr{
B: " ",
Sz: &attrValInt{Val: 9},
Sz: &attrValFloat{Val: 9},
Color: &xlsxColor{
Indexed: 81,
},
Expand All @@ -182,7 +182,7 @@ func (f *File) addComment(commentsXML, cell string, formatSet *formatComment) {
},
{
RPr: &xlsxRPr{
Sz: &attrValInt{Val: 9},
Sz: &attrValFloat{Val: 9},
Color: &xlsxColor{
Indexed: 81,
},
Expand Down
6 changes: 6 additions & 0 deletions xmlChart.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ type attrValInt struct {
Val int `xml:"val,attr"`
}

// attrValFloat directly maps the val element with float64 data type as an
// attribute。
type attrValFloat struct {
Val float64 `xml:"val,attr"`
}

// attrValBool directly maps the val element with boolean data type as an
// attribute。
type attrValBool struct {
Expand Down
2 changes: 1 addition & 1 deletion xmlSharedStrings.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type xlsxR struct {
// styles.
type xlsxRPr struct {
B string `xml:"b,omitempty"`
Sz *attrValInt `xml:"sz"`
Sz *attrValFloat `xml:"sz"`
Color *xlsxColor `xml:"color"`
RFont *attrValString `xml:"rFont"`
Family *attrValInt `xml:"family"`
Expand Down

0 comments on commit 574a6b2

Please sign in to comment.