diff --git a/LICENSE b/LICENSE index 1962b4a393190f22c64e60324490ea30efbb9699..51ec1fbebbf94cdd3e7e214aa738095a37e5d279 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ BSD 3-Clause License -Copyright (c) 2016-2019, 360 Enterprise Security Group, Endpoint Security, Inc. -Copyright (c) 2011-2017, Geoffrey J. Teale (complying with the tealeg/xlsx license) +Copyright (c) 2016-2020, 360 Enterprise Security Group, Endpoint Security, Inc. +Copyright (c) 2011-2017, Geoffrey J. Teale All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 03e33aeed0d23ffe7b6e9aae44ec2e0a2ddd0882..d7f696cc51d5dc9c0f987f3167fd86976efed0fa 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,7 @@ Here is a minimal example usage that will create XLSX file. ```go package main -import ( - "fmt" - - "github.com/360EntSecGroup-Skylar/excelize" -) +import "github.com/360EntSecGroup-Skylar/excelize" func main() { f := excelize.NewFile() @@ -47,9 +43,8 @@ func main() { // Set active sheet of the workbook. f.SetActiveSheet(index) // Save xlsx file by the given path. - err := f.SaveAs("./Book1.xlsx") - if err != nil { - fmt.Println(err) + if err := f.SaveAs("Book1.xlsx"); err != nil { + println(err.Error()) } } ``` @@ -61,32 +56,28 @@ The following constitutes the bare to read a XLSX document. ```go package main -import ( - "fmt" - - "github.com/360EntSecGroup-Skylar/excelize" -) +import "github.com/360EntSecGroup-Skylar/excelize" func main() { - f, err := excelize.OpenFile("./Book1.xlsx") + f, err := excelize.OpenFile("Book1.xlsx") if err != nil { - fmt.Println(err) + println(err.Error()) return } // Get value from cell by given worksheet name and axis. cell, err := f.GetCellValue("Sheet1", "B2") if err != nil { - fmt.Println(err) + println(err.Error()) return } - fmt.Println(cell) + println(cell) // Get all the rows in the Sheet1. rows, err := f.GetRows("Sheet1") for _, row := range rows { for _, colCell := range row { - fmt.Print(colCell, "\t") + print(colCell, "\t") } - fmt.Println() + println() } } ``` @@ -100,11 +91,7 @@ With Excelize chart generation and management is as easy as a few lines of code. ```go package main -import ( - "fmt" - - "github.com/360EntSecGroup-Skylar/excelize" -) +import "github.com/360EntSecGroup-Skylar/excelize" func main() { categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"} @@ -116,15 +103,13 @@ func main() { for k, v := range values { f.SetCellValue("Sheet1", k, v) } - err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`) - if err != nil { - fmt.Println(err) + if err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`); err != nil { + println(err.Error()) return } // Save xlsx file by the given path. - err = f.SaveAs("./Book1.xlsx") - if err != nil { - fmt.Println(err) + if err := f.SaveAs("Book1.xlsx"); err != nil { + println(err.Error()) } } ``` @@ -135,7 +120,6 @@ func main() { package main import ( - "fmt" _ "image/gif" _ "image/jpeg" _ "image/png" @@ -144,30 +128,26 @@ import ( ) func main() { - f, err := excelize.OpenFile("./Book1.xlsx") + f, err := excelize.OpenFile("Book1.xlsx") if err != nil { - fmt.Println(err) + println(err.Error()) return } // Insert a picture. - err = f.AddPicture("Sheet1", "A2", "./image1.png", "") - if err != nil { - fmt.Println(err) + if err := f.AddPicture("Sheet1", "A2", "image.png", ""); err != nil { + println(err.Error()) } // Insert a picture to worksheet with scaling. - err = f.AddPicture("Sheet1", "D2", "./image2.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`) - if err != nil { - fmt.Println(err) + if err := f.AddPicture("Sheet1", "D2", "image.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`); err != nil { + println(err.Error()) } // Insert a picture offset in the cell with printing support. - err = f.AddPicture("Sheet1", "H2", "./image3.gif", `{"x_offset": 15, "y_offset": 10, "print_obj": true, "lock_aspect_ratio": false, "locked": false}`) - if err != nil { - fmt.Println(err) + if err := f.AddPicture("Sheet1", "H2", "image.gif", `{"x_offset": 15, "y_offset": 10, "print_obj": true, "lock_aspect_ratio": false, "locked": false}`); err != nil { + println(err.Error()) } // Save the xlsx file with the origin path. - err = f.Save() - if err != nil { - fmt.Println(err) + if err = f.Save(); err != nil { + println(err.Error()) } } ``` diff --git a/README_zh.md b/README_zh.md index 57cd645557e901043fb22c08b4c6264b764287c6..c1ee83e3eb290340f1e5da96a64ea5d4e7d55585 100644 --- a/README_zh.md +++ b/README_zh.md @@ -30,11 +30,7 @@ go get github.com/360EntSecGroup-Skylar/excelize ```go package main -import ( - "fmt" - - "github.com/360EntSecGroup-Skylar/excelize" -) +import "github.com/360EntSecGroup-Skylar/excelize" func main() { f := excelize.NewFile() @@ -46,9 +42,8 @@ func main() { // 设置工作簿的默认工作表 f.SetActiveSheet(index) // 根据指定路径保存文件 - err := f.SaveAs("./Book1.xlsx") - if err != nil { - fmt.Println(err) + if err := f.SaveAs("Book1.xlsx"); err != nil { + println(err.Error()) } } ``` @@ -60,32 +55,28 @@ func main() { ```go package main -import ( - "fmt" - - "github.com/360EntSecGroup-Skylar/excelize" -) +import "github.com/360EntSecGroup-Skylar/excelize" func main() { - f, err := excelize.OpenFile("./Book1.xlsx") + f, err := excelize.OpenFile("Book1.xlsx") if err != nil { - fmt.Println(err) + println(err.Error()) return } // 获取工作表中指定单元格的值 cell, err := f.GetCellValue("Sheet1", "B2") if err != nil { - fmt.Println(err) + println(err.Error()) return } - fmt.Println(cell) + println(cell) // 获取 Sheet1 上所有单元格 rows, err := f.GetRows("Sheet1") for _, row := range rows { for _, colCell := range row { - fmt.Print(colCell, "\t") + print(colCell, "\t") } - fmt.Println() + println() } } ``` @@ -99,11 +90,7 @@ func main() { ```go package main -import ( - "fmt" - - "github.com/360EntSecGroup-Skylar/excelize" -) +import "github.com/360EntSecGroup-Skylar/excelize" func main() { categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"} @@ -115,18 +102,15 @@ func main() { for k, v := range values { f.SetCellValue("Sheet1", k, v) } - err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`) - if err != nil { - fmt.Println(err) + if err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`); err != nil { + println(err.Error()) return } // 根据指定路径保存文件 - err = f.SaveAs("./Book1.xlsx") - if err != nil { - fmt.Println(err) + if err := f.SaveAs("Book1.xlsx"); err != nil { + println(err.Error()) } } - ``` ### 向 Excel 文档中插入图片 @@ -135,7 +119,6 @@ func main() { package main import ( - "fmt" _ "image/gif" _ "image/jpeg" _ "image/png" @@ -144,30 +127,26 @@ import ( ) func main() { - f, err := excelize.OpenFile("./Book1.xlsx") + f, err := excelize.OpenFile("Book1.xlsx") if err != nil { - fmt.Println(err) + println(err.Error()) return } // 插入图片 - err = f.AddPicture("Sheet1", "A2", "./image1.png", "") - if err != nil { - fmt.Println(err) + if err := f.AddPicture("Sheet1", "A2", "image.png", ""); err != nil { + println(err.Error()) } // 在工作表中插入图片,并设置图片的缩放比例 - err = f.AddPicture("Sheet1", "D2", "./image2.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`) - if err != nil { - fmt.Println(err) + if err := f.AddPicture("Sheet1", "D2", "image.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`); err != nil { + println(err.Error()) } // 在工作表中插入图片,并设置图片的打印属性 - err = f.AddPicture("Sheet1", "H2", "./image3.gif", `{"x_offset": 15, "y_offset": 10, "print_obj": true, "lock_aspect_ratio": false, "locked": false}`) - if err != nil { - fmt.Println(err) + if err := f.AddPicture("Sheet1", "H2", "image.gif", `{"x_offset": 15, "y_offset": 10, "print_obj": true, "lock_aspect_ratio": false, "locked": false}`); err != nil { + println(err.Error()) } // 保存文件 - err = f.Save() - if err != nil { - fmt.Println(err) + if err = f.Save(); err != nil { + println(err.Error()) } } ``` diff --git a/adjust.go b/adjust.go index 69ded1beee283bfd4f43d1821426af1c4682f9b5..bedeec0ebd588063dca59d5e3a268202e9408672 100644 --- a/adjust.go +++ b/adjust.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // @@ -213,6 +213,8 @@ func areaRangeToCoordinates(firstCell, lastCell string) ([]int, error) { return coordinates, err } +// sortCoordinates provides a function to correct the coordinate area, such +// correct C1:B3 to B1:C3. func sortCoordinates(coordinates []int) error { if len(coordinates) != 4 { return errors.New("coordinates length must be 4") diff --git a/adjust_test.go b/adjust_test.go index a0de844a8829052a26bfffc32509667214659dbf..13e47ffeab329b61eb83f54feee49d24d5065d54 100644 --- a/adjust_test.go +++ b/adjust_test.go @@ -114,3 +114,7 @@ func TestCoordinatesToAreaRef(t *testing.T) { assert.NoError(t, err) assert.EqualValues(t, ref, "A1:A1") } + +func TestSortCoordinates(t *testing.T) { + assert.EqualError(t, sortCoordinates(make([]int, 3)), "coordinates length must be 4") +} diff --git a/calcchain.go b/calcchain.go index a3d38204965827fc579207aa19c731ede174cd45..f50fb1d575178c2095a9c07263c11935a00a556e 100644 --- a/calcchain.go +++ b/calcchain.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/cell.go b/cell.go index 1aeddc1f4969dce9310ba4329244e91be7924132..a65968032fc0f5eee6f0fa9e485b52a8b654312e 100644 --- a/cell.go +++ b/cell.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/cellmerged.go b/cellmerged.go index 5bea0bc708b3ebe3b697b7c3dc63e5ad79e782ff..b952a1ede5c96f39064bd44d4059aee84625dc4c 100644 --- a/cellmerged.go +++ b/cellmerged.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // @@ -43,13 +43,7 @@ func (f *File) MergeCell(sheet, hcell, vcell string) error { return err } // Correct the coordinate area, such correct C1:B3 to B1:C3. - if rect1[2] < rect1[0] { - rect1[0], rect1[2] = rect1[2], rect1[0] - } - - if rect1[3] < rect1[1] { - rect1[1], rect1[3] = rect1[3], rect1[1] - } + _ = sortCoordinates(rect1) hcell, _ = CoordinatesToCellName(rect1[0], rect1[1]) vcell, _ = CoordinatesToCellName(rect1[2], rect1[3]) @@ -123,12 +117,8 @@ func (f *File) UnmergeCell(sheet string, hcell, vcell string) error { return err } - if rect1[2] < rect1[0] { - rect1[0], rect1[2] = rect1[2], rect1[0] - } - if rect1[3] < rect1[1] { - rect1[1], rect1[3] = rect1[3], rect1[1] - } + // Correct the coordinate area, such correct C1:B3 to B1:C3. + _ = sortCoordinates(rect1) // return nil since no MergeCells in the sheet if xlsx.MergeCells == nil { diff --git a/chart.go b/chart.go index 8b38d22aa19e399c6ff41824ac0afc6eb8571ed6..b5ff3d11777e37caff6a714d07e3ed1ed59ac2fe 100644 --- a/chart.go +++ b/chart.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // @@ -657,6 +657,7 @@ func parseFormatChartSet(formatSet string) (*formatChart, error) { // // major_grid_lines // minor_grid_lines +// tick_label_skip // reverse_order // maximum // minimum @@ -666,7 +667,6 @@ func parseFormatChartSet(formatSet string) (*formatChart, error) { // major_grid_lines // minor_grid_lines // major_unit -// tick_label_skip // reverse_order // maximum // minimum diff --git a/col.go b/col.go index 5d4e764b19f5bed4444b7729385539a89b38260a..f7e6bcd2156b92ac8e6731653840973f3fb1e04b 100644 --- a/col.go +++ b/col.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/comment.go b/comment.go index 486a035ecfd8a3655b961f691ddf47980328cb9f..a5b6085fb1258104823c539c7615b6f5308360f7 100644 --- a/comment.go +++ b/comment.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/comment_test.go b/comment_test.go index dd0795131b6b45633a0371aba425e9e3c84571ab..5b83162c785ab701d1edb10733d41b1b5130c58d 100644 --- a/comment_test.go +++ b/comment_test.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/datavalidation.go b/datavalidation.go index 2499035fbcdeeb60529d0f36dd54e1e8cb42d862..8b95b407fc5cce2e448296ed906076a28e0f9ee7 100644 --- a/datavalidation.go +++ b/datavalidation.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/datavalidation_test.go b/datavalidation_test.go index 7e54d551761e6268459e111a69a5cc74dd64bcb2..c245df3315b2151f8ebf41e53a9094df02c9c70e 100644 --- a/datavalidation_test.go +++ b/datavalidation_test.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/date.go b/date.go index 8f637029fdd0bce6b8accc73577bfe0e999bf873..dad39b52538c2a88dd527289b915d7f3cc52ee78 100644 --- a/date.go +++ b/date.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/docProps.go b/docProps.go index 884eb6317fe2c3c9fa808ba08c6bccfd6baf0a71..a61ee7170a55ef660c68b302f576a60803e0bf74 100644 --- a/docProps.go +++ b/docProps.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/docProps_test.go b/docProps_test.go index 30c31494b12fe9700a707747ee266c078a5c8739..ef930aefc452741634fd55f9ab0c1011c6afc084 100644 --- a/docProps_test.go +++ b/docProps_test.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/errors.go b/errors.go index 8520a012f5d6a13eb073c6a5ad27eb153bc0ab28..456049743eb34da141e4f56af411c130c52e3cbd 100644 --- a/errors.go +++ b/errors.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/excelize.go b/excelize.go index 94f401c0a58c32d5389ed499cf71ef61337a1b25..8fbd3153c5184b2b5eaafe79c739a6367b197ddb 100644 --- a/excelize.go +++ b/excelize.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. diff --git a/excelize_test.go b/excelize_test.go index c4b600d58020ee46aec18db70ccb465f3a82621d..ea8282882952b84e5df84ef078f37d74d1798a21 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -894,124 +894,11 @@ func TestCopySheetError(t *testing.T) { assert.NoError(t, f.SaveAs(filepath.Join("test", "TestCopySheetError.xlsx"))) } -func TestAddTable(t *testing.T) { - f, err := prepareTestBook1() - if !assert.NoError(t, err) { - t.FailNow() - } - - err = f.AddTable("Sheet1", "B26", "A21", `{}`) - if !assert.NoError(t, err) { - t.FailNow() - } - - err = f.AddTable("Sheet2", "A2", "B5", `{"table_name":"table","table_style":"TableStyleMedium2", "show_first_column":true,"show_last_column":true,"show_row_stripes":false,"show_column_stripes":true}`) - if !assert.NoError(t, err) { - t.FailNow() - } - - err = f.AddTable("Sheet2", "F1", "F1", `{"table_style":"TableStyleMedium8"}`) - if !assert.NoError(t, err) { - t.FailNow() - } - - // Test add table with illegal formatset. - assert.EqualError(t, f.AddTable("Sheet1", "B26", "A21", `{x}`), "invalid character 'x' looking for beginning of object key string") - // Test add table with illegal cell coordinates. - assert.EqualError(t, f.AddTable("Sheet1", "A", "B1", `{}`), `cannot convert cell "A" to coordinates: invalid cell name "A"`) - assert.EqualError(t, f.AddTable("Sheet1", "A1", "B", `{}`), `cannot convert cell "B" to coordinates: invalid cell name "B"`) - - assert.NoError(t, f.SaveAs(filepath.Join("test", "TestAddTable.xlsx"))) - - // Test addTable with illegal cell coordinates. - f = NewFile() - assert.EqualError(t, f.addTable("sheet1", "", 0, 0, 0, 0, 0, nil), "invalid cell coordinates [0, 0]") - assert.EqualError(t, f.addTable("sheet1", "", 1, 1, 0, 0, 0, nil), "invalid cell coordinates [0, 0]") -} - -func TestAddShape(t *testing.T) { - f, err := prepareTestBook1() - if !assert.NoError(t, err) { - t.FailNow() - } - - assert.NoError(t, f.AddShape("Sheet1", "A30", `{"type":"rect","paragraph":[{"text":"Rectangle","font":{"color":"CD5C5C"}},{"text":"Shape","font":{"bold":true,"color":"2980B9"}}]}`)) - assert.NoError(t, f.AddShape("Sheet1", "B30", `{"type":"rect","paragraph":[{"text":"Rectangle"},{}]}`)) - assert.NoError(t, f.AddShape("Sheet1", "C30", `{"type":"rect","paragraph":[]}`)) - assert.EqualError(t, f.AddShape("Sheet3", "H1", `{"type":"ellipseRibbon", "color":{"line":"#4286f4","fill":"#8eb9ff"}, "paragraph":[{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777","underline":"single"}}], "height": 90}`), "sheet Sheet3 is not exist") - assert.EqualError(t, f.AddShape("Sheet3", "H1", ""), "unexpected end of JSON input") - assert.EqualError(t, f.AddShape("Sheet1", "A", `{"type":"rect","paragraph":[{"text":"Rectangle","font":{"color":"CD5C5C"}},{"text":"Shape","font":{"bold":true,"color":"2980B9"}}]}`), `cannot convert cell "A" to coordinates: invalid cell name "A"`) - assert.NoError(t, f.SaveAs(filepath.Join("test", "TestAddShape1.xlsx"))) - - // Test add first shape for given sheet. - f = NewFile() - assert.NoError(t, f.AddShape("Sheet1", "A1", `{"type":"ellipseRibbon", "color":{"line":"#4286f4","fill":"#8eb9ff"}, "paragraph":[{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777","underline":"single"}}], "height": 90}`)) - assert.NoError(t, f.SaveAs(filepath.Join("test", "TestAddShape2.xlsx"))) -} - func TestGetSheetComments(t *testing.T) { f := NewFile() assert.Equal(t, "", f.getSheetComments(0)) } -func TestAutoFilter(t *testing.T) { - outFile := filepath.Join("test", "TestAutoFilter%d.xlsx") - - f, err := prepareTestBook1() - if !assert.NoError(t, err) { - t.FailNow() - } - - formats := []string{ - ``, - `{"column":"B","expression":"x != blanks"}`, - `{"column":"B","expression":"x == blanks"}`, - `{"column":"B","expression":"x != nonblanks"}`, - `{"column":"B","expression":"x == nonblanks"}`, - `{"column":"B","expression":"x <= 1 and x >= 2"}`, - `{"column":"B","expression":"x == 1 or x == 2"}`, - `{"column":"B","expression":"x == 1 or x == 2*"}`, - } - - for i, format := range formats { - t.Run(fmt.Sprintf("Expression%d", i+1), func(t *testing.T) { - err = f.AutoFilter("Sheet1", "D4", "B1", format) - assert.NoError(t, err) - assert.NoError(t, f.SaveAs(fmt.Sprintf(outFile, i+1))) - }) - } - - // testing AutoFilter with illegal cell coordinates. - assert.EqualError(t, f.AutoFilter("Sheet1", "A", "B1", ""), `cannot convert cell "A" to coordinates: invalid cell name "A"`) - assert.EqualError(t, f.AutoFilter("Sheet1", "A1", "B", ""), `cannot convert cell "B" to coordinates: invalid cell name "B"`) -} - -func TestAutoFilterError(t *testing.T) { - outFile := filepath.Join("test", "TestAutoFilterError%d.xlsx") - - f, err := prepareTestBook1() - if !assert.NoError(t, err) { - t.FailNow() - } - - formats := []string{ - `{"column":"B","expression":"x <= 1 and x >= blanks"}`, - `{"column":"B","expression":"x -- y or x == *2*"}`, - `{"column":"B","expression":"x != y or x ? *2"}`, - `{"column":"B","expression":"x -- y o r x == *2"}`, - `{"column":"B","expression":"x -- y"}`, - `{"column":"A","expression":"x -- y"}`, - } - for i, format := range formats { - t.Run(fmt.Sprintf("Expression%d", i+1), func(t *testing.T) { - err = f.AutoFilter("Sheet3", "D4", "B1", format) - if assert.Error(t, err) { - assert.NoError(t, f.SaveAs(fmt.Sprintf(outFile, i+1))) - } - }) - } -} - func TestSetActiveSheet(t *testing.T) { f := NewFile() f.WorkBook.BookViews = nil diff --git a/file.go b/file.go index d8f10facfa67cf1fedd356166e443c2787139265..6213bb169b65a86ef4e3c59698dee650f6135f0c 100644 --- a/file.go +++ b/file.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/lib.go b/lib.go index 86f8d16dc22583a4a36c0f06086b774a7af1b881..2d606faee4f7a11c8d7e0182535eac6a8c8fbc0a 100644 --- a/lib.go +++ b/lib.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/picture.go b/picture.go index 01df8492fefc4029b4ba10a04699a8c624d0508f..80b0a528d98f9750b1757d9c6739bfbdd91251a4 100644 --- a/picture.go +++ b/picture.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/pivotTable.go b/pivotTable.go index 6045e41c8c605cbb99438eecf0a28ee6547d2e44..8610280539ae294e275eacfd07e8c9be4c0f7997 100644 --- a/pivotTable.go +++ b/pivotTable.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/rows.go b/rows.go index 687828c79cbb997ba99e5e4545a91d13a3357daf..20b4379da1e1383510e62d0e124645edabdf7023 100644 --- a/rows.go +++ b/rows.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/shape.go b/shape.go index 2ea66ea4d17b8fa4ec3414c82497b1e12c466012..e9bdb42ea4d38e9ebb361ba14ae8600e0b813236 100644 --- a/shape.go +++ b/shape.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/shape_test.go b/shape_test.go new file mode 100644 index 0000000000000000000000000000000000000000..61fb443d7d69d1f0984c9fa71e3e60caa6dc96a8 --- /dev/null +++ b/shape_test.go @@ -0,0 +1,28 @@ +package excelize + +import ( + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestAddShape(t *testing.T) { + f, err := prepareTestBook1() + if !assert.NoError(t, err) { + t.FailNow() + } + + assert.NoError(t, f.AddShape("Sheet1", "A30", `{"type":"rect","paragraph":[{"text":"Rectangle","font":{"color":"CD5C5C"}},{"text":"Shape","font":{"bold":true,"color":"2980B9"}}]}`)) + assert.NoError(t, f.AddShape("Sheet1", "B30", `{"type":"rect","paragraph":[{"text":"Rectangle"},{}]}`)) + assert.NoError(t, f.AddShape("Sheet1", "C30", `{"type":"rect","paragraph":[]}`)) + assert.EqualError(t, f.AddShape("Sheet3", "H1", `{"type":"ellipseRibbon", "color":{"line":"#4286f4","fill":"#8eb9ff"}, "paragraph":[{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777","underline":"single"}}], "height": 90}`), "sheet Sheet3 is not exist") + assert.EqualError(t, f.AddShape("Sheet3", "H1", ""), "unexpected end of JSON input") + assert.EqualError(t, f.AddShape("Sheet1", "A", `{"type":"rect","paragraph":[{"text":"Rectangle","font":{"color":"CD5C5C"}},{"text":"Shape","font":{"bold":true,"color":"2980B9"}}]}`), `cannot convert cell "A" to coordinates: invalid cell name "A"`) + assert.NoError(t, f.SaveAs(filepath.Join("test", "TestAddShape1.xlsx"))) + + // Test add first shape for given sheet. + f = NewFile() + assert.NoError(t, f.AddShape("Sheet1", "A1", `{"type":"ellipseRibbon", "color":{"line":"#4286f4","fill":"#8eb9ff"}, "paragraph":[{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777","underline":"single"}}], "height": 90}`)) + assert.NoError(t, f.SaveAs(filepath.Join("test", "TestAddShape2.xlsx"))) +} diff --git a/sheet.go b/sheet.go index 954de5bc6697bdfbb2bcc26c3be49b3aa3e18299..2654b8f993c5664493c67af2b22e44865e245b16 100644 --- a/sheet.go +++ b/sheet.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/sheetpr.go b/sheetpr.go index 086bd3a15df86d018e9abed3491c504c275e7d9f..350e189a34455fd57adb8e03795521d75266b5f7 100644 --- a/sheetpr.go +++ b/sheetpr.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/sheetview.go b/sheetview.go index 8a5091f7106bcf8aca1ef7939a338c039c02f1f4..fa3cfdfaaa37ef0bd5dfa37c7f3ba9ffda3636e0 100644 --- a/sheetview.go +++ b/sheetview.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/sparkline.go b/sparkline.go index 47c8d5a217da7d652cba3d516049b876e38a97fe..ef99da6771fd007d4b485b8fc87f7b3f4120e7aa 100644 --- a/sparkline.go +++ b/sparkline.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/stream.go b/stream.go index e981f781f4f95ad3de908b3aca536cb5b95ddd35..9facf3136c6abeefd2b4fc11356f9f25b82b84b1 100644 --- a/stream.go +++ b/stream.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // @@ -36,20 +36,27 @@ type StreamWriter struct { // rows, you must call the 'Flush' method to end the streaming writing // process and ensure that the order of line numbers is ascending. For // example, set data for worksheet of size 102400 rows x 50 columns with -// numbers: +// numbers and style: // // file := excelize.NewFile() // streamWriter, err := file.NewStreamWriter("Sheet1") // if err != nil { // panic(err) // } -// for rowID := 1; rowID <= 102400; rowID++ { +// styleID, err := file.NewStyle(`{"font":{"color":"#777777"}}`) +// if err != nil { +// panic(err) +// } +// if err := streamWriter.SetRow("A1", []interface{}{excelize.Cell{StyleID: styleID, Value: "Data"}}); err != nil { +// panic(err) +// } +// for rowID := 2; rowID <= 102400; rowID++ { // row := make([]interface{}, 50) // for colID := 0; colID < 50; colID++ { // row[colID] = rand.Intn(640000) // } // cell, _ := excelize.CoordinatesToCellName(1, rowID) -// if err := streamWriter.SetRow(cell, row, nil); err != nil { +// if err := streamWriter.SetRow(cell, row); err != nil { // panic(err) // } // } @@ -107,7 +114,7 @@ func (sw *StreamWriter) AddTable(hcell, vcell, format string) error { if err != nil { return err } - sortCoordinates(coordinates) + _ = sortCoordinates(coordinates) // Correct the minimum number of rows, the table at least two lines. if coordinates[1] == coordinates[3] { @@ -188,7 +195,7 @@ func (sw *StreamWriter) getRowValues(hrow, hcol, vcol int) (res []string, err er return nil, err } - dec := xml.NewDecoder(r) + dec := sw.File.xmlNewDecoder(r) for { token, err := dec.Token() if err == io.EOF { @@ -248,7 +255,7 @@ func getRowElement(token xml.Token, hrow int) (startElement xml.StartElement, ok // a value. type Cell struct { StyleID int - Value interface{} + Value interface{} } // SetRow writes an array to stream rows by giving a worksheet name, starting @@ -277,47 +284,8 @@ func (sw *StreamWriter) SetRow(axis string, values []interface{}) error { c.S = v.StyleID val = v.Value } - switch val := val.(type) { - case int: - c.T, c.V = setCellInt(val) - case int8: - c.T, c.V = setCellInt(int(val)) - case int16: - c.T, c.V = setCellInt(int(val)) - case int32: - c.T, c.V = setCellInt(int(val)) - case int64: - c.T, c.V = setCellInt(int(val)) - case uint: - c.T, c.V = setCellInt(int(val)) - case uint8: - c.T, c.V = setCellInt(int(val)) - case uint16: - c.T, c.V = setCellInt(int(val)) - case uint32: - c.T, c.V = setCellInt(int(val)) - case uint64: - c.T, c.V = setCellInt(int(val)) - case float32: - c.T, c.V = setCellFloat(float64(val), -1, 32) - case float64: - c.T, c.V = setCellFloat(val, -1, 64) - case string: - c.T, c.V, c.XMLSpace = setCellStr(val) - case []byte: - c.T, c.V, c.XMLSpace = setCellStr(string(val)) - case time.Duration: - c.T, c.V = setCellDuration(val) - case time.Time: - c.T, c.V, _, err = setCellTime(val) - case bool: - c.T, c.V = setCellBool(val) - case nil: - c.T, c.V, c.XMLSpace = setCellStr("") - default: - c.T, c.V, c.XMLSpace = setCellStr(fmt.Sprint(val)) - } - if err != nil { + if err = setCellValFunc(&c, val); err != nil { + sw.rawData.WriteString(``) return err } writeCell(&sw.rawData, c) @@ -326,6 +294,61 @@ func (sw *StreamWriter) SetRow(axis string, values []interface{}) error { return sw.rawData.Sync() } +// setCellValFunc provides a function to set value of a cell. +func setCellValFunc(c *xlsxC, val interface{}) (err error) { + switch val := val.(type) { + case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64: + err = setCellIntFunc(c, val) + case float32: + c.T, c.V = setCellFloat(float64(val), -1, 32) + case float64: + c.T, c.V = setCellFloat(val, -1, 64) + case string: + c.T, c.V, c.XMLSpace = setCellStr(val) + case []byte: + c.T, c.V, c.XMLSpace = setCellStr(string(val)) + case time.Duration: + c.T, c.V = setCellDuration(val) + case time.Time: + c.T, c.V, _, err = setCellTime(val) + case bool: + c.T, c.V = setCellBool(val) + case nil: + c.T, c.V, c.XMLSpace = setCellStr("") + default: + c.T, c.V, c.XMLSpace = setCellStr(fmt.Sprint(val)) + } + return err +} + +// setCellIntFunc is a wrapper of SetCellInt. +func setCellIntFunc(c *xlsxC, val interface{}) (err error) { + switch val := val.(type) { + case int: + c.T, c.V = setCellInt(val) + case int8: + c.T, c.V = setCellInt(int(val)) + case int16: + c.T, c.V = setCellInt(int(val)) + case int32: + c.T, c.V = setCellInt(int(val)) + case int64: + c.T, c.V = setCellInt(int(val)) + case uint: + c.T, c.V = setCellInt(int(val)) + case uint8: + c.T, c.V = setCellInt(int(val)) + case uint16: + c.T, c.V = setCellInt(int(val)) + case uint32: + c.T, c.V = setCellInt(int(val)) + case uint64: + c.T, c.V = setCellInt(int(val)) + default: + } + return +} + func writeCell(buf *bufferedWriter, c xlsxC) { buf.WriteString(`= 2"}`, + `{"column":"B","expression":"x == 1 or x == 2"}`, + `{"column":"B","expression":"x == 1 or x == 2*"}`, + } + + for i, format := range formats { + t.Run(fmt.Sprintf("Expression%d", i+1), func(t *testing.T) { + err = f.AutoFilter("Sheet1", "D4", "B1", format) + assert.NoError(t, err) + assert.NoError(t, f.SaveAs(fmt.Sprintf(outFile, i+1))) + }) + } + + // testing AutoFilter with illegal cell coordinates. + assert.EqualError(t, f.AutoFilter("Sheet1", "A", "B1", ""), `cannot convert cell "A" to coordinates: invalid cell name "A"`) + assert.EqualError(t, f.AutoFilter("Sheet1", "A1", "B", ""), `cannot convert cell "B" to coordinates: invalid cell name "B"`) +} + +func TestAutoFilterError(t *testing.T) { + outFile := filepath.Join("test", "TestAutoFilterError%d.xlsx") + + f, err := prepareTestBook1() + if !assert.NoError(t, err) { + t.FailNow() + } + + formats := []string{ + `{"column":"B","expression":"x <= 1 and x >= blanks"}`, + `{"column":"B","expression":"x -- y or x == *2*"}`, + `{"column":"B","expression":"x != y or x ? *2"}`, + `{"column":"B","expression":"x -- y o r x == *2"}`, + `{"column":"B","expression":"x -- y"}`, + `{"column":"A","expression":"x -- y"}`, + } + for i, format := range formats { + t.Run(fmt.Sprintf("Expression%d", i+1), func(t *testing.T) { + err = f.AutoFilter("Sheet3", "D4", "B1", format) + if assert.Error(t, err) { + assert.NoError(t, f.SaveAs(fmt.Sprintf(outFile, i+1))) + } + }) + } + + assert.EqualError(t, f.autoFilter("Sheet1", "A1", 1, 1, &formatAutoFilter{ + Column: "-", + Expression: "-", + }), `invalid column name "-"`) + assert.EqualError(t, f.autoFilter("Sheet1", "A1", 1, 100, &formatAutoFilter{ + Column: "A", + Expression: "-", + }), `incorrect index of column 'A'`) + assert.EqualError(t, f.autoFilter("Sheet1", "A1", 1, 1, &formatAutoFilter{ + Column: "A", + Expression: "-", + }), `incorrect number of tokens in criteria '-'`) +} + +func TestParseFilterTokens(t *testing.T) { + f := NewFile() + // Test with unknown operator. + _, _, err := f.parseFilterTokens("", []string{"", "!"}) + assert.EqualError(t, err, "unknown operator: !") + // Test invalid operator in context. + _, _, err = f.parseFilterTokens("", []string{"", "<", "x != blanks"}) + assert.EqualError(t, err, "the operator '<' in expression '' is not valid in relation to Blanks/NonBlanks'") +} diff --git a/templates.go b/templates.go index 5b79b0c806244760ef7fd07948d2d9f84dce8e0a..a7972e6169c94f33e6863f322170dd351c0c0b19 100644 --- a/templates.go +++ b/templates.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/vmlDrawing.go b/vmlDrawing.go index 24b615fd4dbe577157946d114ec6b4e169d4039b..f2d55f17f10240547637c3380f476c7118112693 100644 --- a/vmlDrawing.go +++ b/vmlDrawing.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlApp.go b/xmlApp.go index 48450e3ff3d5d2eb23ca5bcece01758b18b9a1a5..5668cf641d531d568f5df0ab543287fdfbef939d 100644 --- a/xmlApp.go +++ b/xmlApp.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlCalcChain.go b/xmlCalcChain.go index 343f15f6efc3b3faf8753f47562d9ec9ddd95a48..69d5d8cad7ead510c4f1ef7c5be70c57dada723f 100644 --- a/xmlCalcChain.go +++ b/xmlCalcChain.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlChart.go b/xmlChart.go index fc38dab126dc1943576fda562ac0b181d95dab8b..b6d041e6590e8227f97743c3847d16dd16d89589 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlComments.go b/xmlComments.go index f13d00243bf597591a0b1955cd84e919ffae465e..687c486d0212df02207c58e115c73c752f9b65cb 100644 --- a/xmlComments.go +++ b/xmlComments.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlContentTypes.go b/xmlContentTypes.go index fa4d3475a665bb383280c7bf43f72b660d74e965..7acfe0876006fbf8884e5e2f7d86cea4a7f4359b 100644 --- a/xmlContentTypes.go +++ b/xmlContentTypes.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlCore.go b/xmlCore.go index 96482fc160c7747a41ac9646ec6c0bf87e85dfcb..6f71a3ef01fce00267da35f82ed2a0f8fb2d6fe0 100644 --- a/xmlCore.go +++ b/xmlCore.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlDecodeDrawing.go b/xmlDecodeDrawing.go index e11bb00d16d9fc1ccdafc210ab1df1847e797d2e..93e0e827f46468c5a7878e739d4c11614b2d339e 100644 --- a/xmlDecodeDrawing.go +++ b/xmlDecodeDrawing.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlDrawing.go b/xmlDrawing.go index 1c24f08eda56ca0307ef3aced6ee83ce580fb417..5bb5977519d2a84e79c500f8aafa3842da1d9c45 100644 --- a/xmlDrawing.go +++ b/xmlDrawing.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlPivotTable.go b/xmlPivotTable.go index 6e1dfb84a00c39ea120caa83f59f5d8904f0605e..82bbf27ff690ad4d5db6b66d8b1afaf941bc2b46 100644 --- a/xmlPivotTable.go +++ b/xmlPivotTable.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlSharedStrings.go b/xmlSharedStrings.go index 79837411bd0bbfd3e3959ee534a6784410040fec..61e5727b8ad5deb866b392dad559447f290e5e06 100644 --- a/xmlSharedStrings.go +++ b/xmlSharedStrings.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlStyles.go b/xmlStyles.go index 16a89abdec0b24f84a3feca9361abe0d011de525..0313008e0bdbdaf9e1778fd877a99265bd85fc2b 100644 --- a/xmlStyles.go +++ b/xmlStyles.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlTable.go b/xmlTable.go index 017bda10620661a17b8dfcf04a36831baeea08a0..345337f24e9badc2b7aeeb86a7a1acacc1817512 100644 --- a/xmlTable.go +++ b/xmlTable.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlTheme.go b/xmlTheme.go index f764c207841c90b184a683bc3e59fa914c0f319c..76f13b4cbc57ddba909eee57d8fce64da4749f4b 100644 --- a/xmlTheme.go +++ b/xmlTheme.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlWorkbook.go b/xmlWorkbook.go index 65606b01e7dad62eff5e2c998bf4321d6d8dbba8..bc5992491164a9c42b6999ca35e2774599310457 100644 --- a/xmlWorkbook.go +++ b/xmlWorkbook.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlWorksheet.go b/xmlWorksheet.go index c17d12fd562edf787df1cb32f7b66eba20a4bf3f..ed304ccbee6a9ddbdb89d291c56b63f949fcf23d 100644 --- a/xmlWorksheet.go +++ b/xmlWorksheet.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. //