Skip to content

Commit

Permalink
gooxml: clean up some old TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaliance committed Sep 30, 2017
1 parent 5bfa034 commit 801388a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
4 changes: 1 addition & 3 deletions chart/doughnutchart.go
Expand Up @@ -27,9 +27,7 @@ func (c DoughnutChart) InitializeDefaults() {
c.x.VaryColors.ValAttr = gooxml.Bool(true)
c.x.HoleSize = crt.NewCT_HoleSize()
c.x.HoleSize.ValAttr = &crt.ST_HoleSize{}
// TODO: fix this
x := uint8(50)
c.x.HoleSize.ValAttr.ST_HoleSizeUByte = &x
c.x.HoleSize.ValAttr.ST_HoleSizeUByte = gooxml.Uint8(50)
}

// SetHoleSize controls the hole size in the pie chart and is measured in percent.
Expand Down
1 change: 0 additions & 1 deletion common/coreproperties.go
Expand Up @@ -97,7 +97,6 @@ func parseTime(x *gooxml.XSDAny) time.Time {
// to write to handle any other format anyway. If you see another format
// in the wild, please let me know.

// TODO: report this error?
t, err := time.Parse(cpTimeFormatW3CDTF, string(x.Data))
if err != nil {
gooxml.Log("error parsing time from %s: %s", string(x.Data), err)
Expand Down
2 changes: 0 additions & 2 deletions drawing/lineproperties.go
Expand Up @@ -26,8 +26,6 @@ func (l LineProperties) X() *dml.CT_LineProperties {
// SetWidth sets the line width, MS products treat zero as the minimum width
// that can be displayed.
func (l LineProperties) SetWidth(w measurement.Distance) {
// TODO: check these units, can't find documentation on them but this seems
// to be the right range
l.x.WAttr = gooxml.Int32(int32(w / measurement.EMU))
}

Expand Down
3 changes: 0 additions & 3 deletions spreadsheet/context.go
Expand Up @@ -47,9 +47,6 @@ func (e *evalContext) Cell(ref string, ev formula.Evaluator) formula.Result {

v, _ := c.GetRawValue()
return formula.MakeStringResult(v)

// TODO: handle this properly
// return formula.MakeErrorResult()
}

func (e *evalContext) Sheet(name string) formula.Context {
Expand Down
4 changes: 2 additions & 2 deletions spreadsheet/format/format.go
Expand Up @@ -153,8 +153,8 @@ func Value(v string, f string) string {
return String(v, f)
}

// String returns the string formatted according to the type.
// TODO: implement if anyone needs this.
// String returns the string formatted according to the type. In format strings
// this is the fourth item, where '@' is used as a placeholder for text.
func String(v string, f string) string {
fmts := Parse(f)
var fm Format
Expand Down
4 changes: 3 additions & 1 deletion spreadsheet/formula/bool.go
Expand Up @@ -9,6 +9,8 @@ package formula

import (
"strconv"

"baliance.com/gooxml"
)

type Bool struct {
Expand All @@ -18,7 +20,7 @@ type Bool struct {
func NewBool(v string) Expression {
b, err := strconv.ParseBool(v)
if err != nil {
// TODO: report erro
gooxml.Log("error parsing formula bool %s: %s", v, err)
}
return Bool{b}
}
Expand Down
2 changes: 1 addition & 1 deletion spreadsheet/formula/fnmathtrig.go
Expand Up @@ -62,7 +62,7 @@ func init() {
RegisterFunction("LOG", Log)
RegisterFunction("LOG10", makeMathWrapper("LOG10", math.Log10))
RegisterFunction("MDETERM", MDeterm)
// RegisterFunction("MINVERSE", MInverse) // TODO: skipping the other matrix functins, not sure how common they are
// RegisterFunction("MINVERSE", MInverse) // TODO: skipping the other matrix functinos, not sure how common they are
// RegisterFunction("MMULT"
RegisterFunction("MOD", Mod)
RegisterFunction("MROUND", Mround)
Expand Down
8 changes: 6 additions & 2 deletions spreadsheet/formula/number.go
Expand Up @@ -7,7 +7,11 @@

package formula

import "strconv"
import (
"strconv"

"baliance.com/gooxml"
)

type Number struct {
v float64
Expand All @@ -16,7 +20,7 @@ type Number struct {
func NewNumber(v string) Expression {
f, err := strconv.ParseFloat(v, 64)
if err != nil {
// TODO: report error
gooxml.Log("error parsing formula number %s: %s", v, err)
}
return Number{f}
}
Expand Down

0 comments on commit 801388a

Please sign in to comment.