Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffrey Teale committed Jun 25, 2013
1 parent 6c1a2a1 commit 1cd8cb3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
16 changes: 9 additions & 7 deletions lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ type Border struct {
// Fill is a high level structure intended to provide user access to
// the contents of background and foreground color index within an Sheet.
type Fill struct {
BgColorIndex string
FgColorIndex string
BgColorIndex string
FgColorIndex string
}

// File is a high level structure providing a slice of Sheet structs
Expand Down Expand Up @@ -249,7 +249,7 @@ func makeRowFromSpan(spans string) *Row {
return row
}

// get the max column
// get the max column
// return the cells of columns
func makeRowFromRaw(rawrow xlsxRow) *Row {
var upper int
Expand Down Expand Up @@ -338,12 +338,14 @@ func readRowsFromSheet(Worksheet *xlsxWorksheet, file *File) ([]*Row, int, int)
rowno := 0
for _, rawcell := range rawrow.C {
x, y, _ := getCoordsFromCellIDString(rawcell.R)
if y != 0 && rowno == 0{
if y != 0 && rowno == 0 {
rowno = y
}
row.Cells[x].Value = getValueFromCellData(rawcell, reftable)
row.Cells[x].styleIndex = rawcell.S
row.Cells[x].styles = file.styles
if x < len(row.Cells) {
row.Cells[x].Value = getValueFromCellData(rawcell, reftable)
row.Cells[x].styleIndex = rawcell.S
row.Cells[x].styles = file.styles
}
}
rows[rowno] = row
}
Expand Down
4 changes: 2 additions & 2 deletions style.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ type xlsxLine struct {
type xlsxXf struct {
ApplyBorder string `xml:"applyBorder,attr"`
BorderId int `xml:"borderId,attr"`
ApplyFill string `xml:"applyFill,attr"`
FillId int `xml:"fillId,attr"`
ApplyFill string `xml:"applyFill,attr"`
FillId int `xml:"fillId,attr"`
}
7 changes: 6 additions & 1 deletion workbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,13 @@ func getWorksheetFromSheet(sheet xlsxSheet, worksheets map[string]*zip.File) (*x
var decoder *xml.Decoder
var worksheet *xlsxWorksheet
var error error
var sheetName string
worksheet = new(xlsxWorksheet)
sheetName := fmt.Sprintf("sheet%s", sheet.Id[3:])
if sheet.SheetId != "" {
sheetName = fmt.Sprintf("sheet%s", sheet.SheetId)
} else {
sheetName = fmt.Sprintf("sheet%s", sheet.Id)
}
f := worksheets[sheetName]
rc, error = f.Open()
if error != nil {
Expand Down

0 comments on commit 1cd8cb3

Please sign in to comment.