summaryrefslogtreecommitdiff
path: root/table.go
diff options
context:
space:
mode:
authorRi Xu <xuri.me@gmail.com>2017-07-30 15:46:04 +0800
committerRi Xu <xuri.me@gmail.com>2017-07-30 15:46:04 +0800
commit308776e350334a8daddcf5f502ee7547f01cc64c (patch)
tree8cc7850e18b2d5dae995c213d27bcb0fab7794c9 /table.go
parent1d54bd4df6542edcce1f820c0b29e2cc00f10563 (diff)
Optimize code, go test and godoc updated.
Diffstat (limited to 'table.go')
-rw-r--r--table.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/table.go b/table.go
index 1417cd9..b274c3b 100644
--- a/table.go
+++ b/table.go
@@ -88,16 +88,11 @@ func (f *File) addSheetTable(sheet string, rID int) {
table := &xlsxTablePart{
RID: "rId" + strconv.Itoa(rID),
}
- if xlsx.TableParts != nil {
- xlsx.TableParts.Count++
- xlsx.TableParts.TableParts = append(xlsx.TableParts.TableParts, table)
- } else {
- xlsx.TableParts = &xlsxTableParts{
- Count: 1,
- TableParts: []*xlsxTablePart{table},
- }
+ if xlsx.TableParts == nil {
+ xlsx.TableParts = &xlsxTableParts{}
}
-
+ xlsx.TableParts.Count++
+ xlsx.TableParts.TableParts = append(xlsx.TableParts.TableParts, table)
}
// addTable provides function to add table by given sheet index, coordinate area