Parcourir la source

#65 fn: N, PERCENTILE.INC and T
typo fixed

xuri il y a 4 ans
Parent
commit
2af96c0714
56 fichiers modifiés avec 177 ajouts et 96 suppressions
  1. 1 1
      adjust.go
  2. 59 1
      calc.go
  3. 20 1
      calc_test.go
  4. 2 2
      calcchain.go
  5. 1 1
      cell.go
  6. 1 1
      chart.go
  7. 1 1
      col.go
  8. 2 2
      comment.go
  9. 1 1
      comment_test.go
  10. 1 1
      crypt_test.go
  11. 2 2
      datavalidation.go
  12. 1 1
      datavalidation_test.go
  13. 2 2
      date.go
  14. 2 2
      docProps.go
  15. 8 6
      docProps_test.go
  16. 1 1
      drawing.go
  17. 7 5
      drawing_test.go
  18. 2 2
      errors.go
  19. 1 1
      excelize.go
  20. 4 4
      excelize_test.go
  21. 1 1
      file.go
  22. 1 1
      lib.go
  23. 2 2
      merge.go
  24. 1 1
      picture.go
  25. 1 1
      picture_test.go
  26. 1 1
      pivotTable.go
  27. 1 1
      rows.go
  28. 2 2
      shape.go
  29. 1 1
      sheet.go
  30. 2 2
      sheetpr.go
  31. 2 2
      sheetview.go
  32. 2 2
      sparkline.go
  33. 1 1
      sparkline_test.go
  34. 1 1
      stream.go
  35. 1 1
      stream_test.go
  36. 1 1
      styles.go
  37. 2 2
      styles_test.go
  38. 1 1
      table.go
  39. 2 2
      templates.go
  40. 2 2
      vmlDrawing.go
  41. 2 2
      xmlApp.go
  42. 2 2
      xmlCalcChain.go
  43. 2 2
      xmlChart.go
  44. 2 2
      xmlComments.go
  45. 2 2
      xmlContentTypes.go
  46. 2 2
      xmlCore.go
  47. 2 2
      xmlDecodeDrawing.go
  48. 1 1
      xmlDrawing.go
  49. 2 2
      xmlPivotCache.go
  50. 2 2
      xmlPivotTable.go
  51. 2 2
      xmlSharedStrings.go
  52. 2 2
      xmlStyles.go
  53. 1 1
      xmlTable.go
  54. 2 2
      xmlTheme.go
  55. 2 2
      xmlWorkbook.go
  56. 2 2
      xmlWorksheet.go

+ 1 - 1
adjust.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 59 - 1
calc.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.
@@ -323,6 +323,7 @@ var tokenPriority = map[string]int{
 //    MROUND
 //    MULTINOMIAL
 //    MUNIT
+//    N
 //    NA
 //    NORM.DIST
 //    NORMDIST
@@ -339,6 +340,7 @@ var tokenPriority = map[string]int{
 //    OCT2HEX
 //    ODD
 //    OR
+//    PERCENTILE.INC
 //    PERCENTILE
 //    PERMUT
 //    PERMUTATIONA
@@ -380,6 +382,7 @@ var tokenPriority = map[string]int{
 //    SUM
 //    SUMIF
 //    SUMSQ
+//    T
 //    TAN
 //    TANH
 //    TODAY
@@ -4521,6 +4524,19 @@ func (fn *formulaFuncs) min(mina bool, argsList *list.List) formulaArg {
 	return newNumberFormulaArg(min)
 }
 
+// PERCENTILEdotINC function returns the k'th percentile (i.e. the value below
+// which k% of the data values fall) for a supplied range of values and a
+// supplied k. The syntax of the function is:
+//
+//    PERCENTILE.INC(array,k)
+//
+func (fn *formulaFuncs) PERCENTILEdotINC(argsList *list.List) formulaArg {
+	if argsList.Len() != 2 {
+		return newErrorFormulaArg(formulaErrorVALUE, "PERCENTILE.INC requires 2 arguments")
+	}
+	return fn.PERCENTILE(argsList)
+}
+
 // PERCENTILE function returns the k'th percentile (i.e. the value below which
 // k% of the data values fall) for a supplied range of values and a supplied
 // k. The syntax of the function is:
@@ -4858,6 +4874,28 @@ func (fn *formulaFuncs) ISTEXT(argsList *list.List) formulaArg {
 	return newBoolFormulaArg(token.Type == ArgString)
 }
 
+// N function converts data into a numeric value. The syntax of the function
+// is:
+//
+//    N(value)
+//
+func (fn *formulaFuncs) N(argsList *list.List) formulaArg {
+	if argsList.Len() != 1 {
+		return newErrorFormulaArg(formulaErrorVALUE, "N requires 1 argument")
+	}
+	token, num := argsList.Front().Value.(formulaArg), 0.0
+	if token.Type == ArgError {
+		return token
+	}
+	if arg := token.ToNumber(); arg.Type == ArgNumber {
+		num = arg.Number
+	}
+	if token.Value() == "TRUE" {
+		num = 1
+	}
+	return newNumberFormulaArg(num)
+}
+
 // NA function returns the Excel #N/A error. This error message has the
 // meaning 'value not available' and is produced when an Excel Formula is
 // unable to find a value that it needs. The syntax of the function is:
@@ -4883,6 +4921,26 @@ func (fn *formulaFuncs) SHEET(argsList *list.List) formulaArg {
 	return newNumberFormulaArg(float64(fn.f.GetSheetIndex(fn.sheet) + 1))
 }
 
+// T function tests if a supplied value is text and if so, returns the
+// supplied text; Otherwise, the function returns an empty text string. The
+// syntax of the function is:
+//
+//    T(value)
+//
+func (fn *formulaFuncs) T(argsList *list.List) formulaArg {
+	if argsList.Len() != 1 {
+		return newErrorFormulaArg(formulaErrorVALUE, "T requires 1 argument")
+	}
+	token := argsList.Front().Value.(formulaArg)
+	if token.Type == ArgError {
+		return token
+	}
+	if token.Type == ArgNumber {
+		return newStringFormulaArg("")
+	}
+	return newStringFormulaArg(token.Value())
+}
+
 // Logical Functions
 
 // AND function tests a number of supplied conditions and returns TRUE or

+ 20 - 1
calc_test.go

@@ -680,6 +680,8 @@ func TestCalcCellValue(t *testing.T) {
 		"=MINA(MUNIT(2))":    "0",
 		"=MINA(INT(1))":      "1",
 		"=MINA(A1:B4,MUNIT(1),INT(0),1,E1:F2,\"\")": "0",
+		// PERCENTILE.INC
+		"=PERCENTILE.INC(A1:A4,0.2)": "0.6",
 		// PERCENTILE
 		"=PERCENTILE(A1:A4,0.2)": "0.6",
 		"=PERCENTILE(0,0)":       "0",
@@ -730,8 +732,17 @@ func TestCalcCellValue(t *testing.T) {
 		// ISTEXT
 		"=ISTEXT(D1)": "TRUE",
 		"=ISTEXT(A1)": "FALSE",
+		// N
+		"=N(10)":     "10",
+		"=N(\"10\")": "10",
+		"=N(\"x\")":  "0",
+		"=N(TRUE)":   "1",
+		"=N(FALSE)":  "0",
 		// SHEET
-		"SHEET()": "1",
+		"=SHEET()": "1",
+		// T
+		"=T(\"text\")": "text",
+		"=T(N(10))":    "",
 		// Logical Functions
 		// AND
 		"=AND(0)":               "FALSE",
@@ -1479,6 +1490,8 @@ func TestCalcCellValue(t *testing.T) {
 		// MINA
 		"=MINA()":     "MINA requires at least 1 argument",
 		"=MINA(NA())": "#N/A",
+		// PERCENTILE.INC
+		"=PERCENTILE.INC()": "PERCENTILE.INC requires 2 arguments",
 		// PERCENTILE
 		"=PERCENTILE()":       "PERCENTILE requires 2 arguments",
 		"=PERCENTILE(0,\"\")": "strconv.ParseFloat: parsing \"\": invalid syntax",
@@ -1525,11 +1538,17 @@ func TestCalcCellValue(t *testing.T) {
 		`=ISODD("text")`: "strconv.Atoi: parsing \"text\": invalid syntax",
 		// ISTEXT
 		"=ISTEXT()": "ISTEXT requires 1 argument",
+		// N
+		"=N()":     "N requires 1 argument",
+		"=N(NA())": "#N/A",
 		// NA
 		"=NA()":  "#N/A",
 		"=NA(1)": "NA accepts no arguments",
 		// SHEET
 		"=SHEET(1)": "SHEET accepts no arguments",
+		// T
+		"=T()":     "T requires 1 argument",
+		"=T(NA())": "#N/A",
 		// Logical Functions
 		// AND
 		`=AND("text")`: "strconv.ParseFloat: parsing \"text\": invalid syntax",

+ 2 - 2
calcchain.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
cell.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
chart.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
col.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
comment.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
comment_test.go

@@ -1,4 +1,4 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //

+ 1 - 1
crypt_test.go

@@ -1,4 +1,4 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //

+ 2 - 2
datavalidation.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
datavalidation_test.go

@@ -1,4 +1,4 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //

+ 2 - 2
date.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
docProps.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 8 - 6
docProps_test.go

@@ -1,11 +1,13 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
-// and read from XLSX files. Support reads and writes XLSX file generated by
-// Microsoft Excel™ 2007 and later. Support save file without losing original
-// charts of XLSX. This library needs Go version 1.10 or later.
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
+// complex components by high compatibility, and provided streaming API for
+// generating or reading data from a worksheet with huge amounts of data. This
+// library needs Go version 1.10 or later.
 
 package excelize
 
@@ -43,7 +45,7 @@ func TestSetDocProps(t *testing.T) {
 	f.XLSX["docProps/core.xml"] = nil
 	assert.NoError(t, f.SetDocProps(&DocProperties{}))
 
-	// Test unsupport charset
+	// Test unsupported charset
 	f = NewFile()
 	f.XLSX["docProps/core.xml"] = MacintoshCyrillicCharset
 	assert.EqualError(t, f.SetDocProps(&DocProperties{}), "xml decode error: XML syntax error on line 1: invalid UTF-8")
@@ -61,7 +63,7 @@ func TestGetDocProps(t *testing.T) {
 	_, err = f.GetDocProps()
 	assert.NoError(t, err)
 
-	// Test unsupport charset
+	// Test unsupported charset
 	f = NewFile()
 	f.XLSX["docProps/core.xml"] = MacintoshCyrillicCharset
 	_, err = f.GetDocProps()

+ 1 - 1
drawing.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 7 - 5
drawing_test.go

@@ -1,11 +1,13 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
-// and read from XLSX files. Support reads and writes XLSX file generated by
-// Microsoft Excel™ 2007 and later. Support save file without losing original
-// charts of XLSX. This library needs Go version 1.10 or later.
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
+// complex components by high compatibility, and provided streaming API for
+// generating or reading data from a worksheet with huge amounts of data. This
+// library needs Go version 1.10 or later.
 
 package excelize
 
@@ -22,6 +24,6 @@ func TestDrawingParser(t *testing.T) {
 	}
 	// Test with one cell anchor
 	f.drawingParser("wsDr")
-	// Test with unsupport charset
+	// Test with unsupported charset
 	f.drawingParser("charset")
 }

+ 2 - 2
errors.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
excelize.go

@@ -1,4 +1,4 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 

+ 4 - 4
excelize_test.go

@@ -1195,7 +1195,7 @@ func TestAddVBAProject(t *testing.T) {
 }
 
 func TestContentTypesReader(t *testing.T) {
-	// Test unsupport charset.
+	// Test unsupported charset.
 	f := NewFile()
 	f.ContentTypes = nil
 	f.XLSX["[Content_Types].xml"] = MacintoshCyrillicCharset
@@ -1203,7 +1203,7 @@ func TestContentTypesReader(t *testing.T) {
 }
 
 func TestWorkbookReader(t *testing.T) {
-	// Test unsupport charset.
+	// Test unsupported charset.
 	f := NewFile()
 	f.WorkBook = nil
 	f.XLSX["xl/workbook.xml"] = MacintoshCyrillicCharset
@@ -1211,7 +1211,7 @@ func TestWorkbookReader(t *testing.T) {
 }
 
 func TestWorkSheetReader(t *testing.T) {
-	// Test unsupport charset.
+	// Test unsupported charset.
 	f := NewFile()
 	delete(f.Sheet, "xl/worksheets/sheet1.xml")
 	f.XLSX["xl/worksheets/sheet1.xml"] = MacintoshCyrillicCharset
@@ -1228,7 +1228,7 @@ func TestWorkSheetReader(t *testing.T) {
 }
 
 func TestRelsReader(t *testing.T) {
-	// Test unsupport charset.
+	// Test unsupported charset.
 	f := NewFile()
 	rels := "xl/_rels/workbook.xml.rels"
 	f.Relationships[rels] = nil

+ 1 - 1
file.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
lib.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
merge.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
picture.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
picture_test.go

@@ -80,7 +80,7 @@ func TestAddPictureErrors(t *testing.T) {
 		assert.True(t, os.IsNotExist(err), "Expected os.IsNotExist(err) == true")
 	}
 
-	// Test add picture to worksheet with unsupport file type.
+	// Test add picture to worksheet with unsupported file type.
 	err = xlsx.AddPicture("Sheet1", "G21", filepath.Join("test", "Book1.xlsx"), "")
 	assert.EqualError(t, err, "unsupported image extension")
 

+ 1 - 1
pivotTable.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
rows.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
shape.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
sheet.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
sheetpr.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
sheetview.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
sparkline.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
sparkline_test.go

@@ -270,7 +270,7 @@ func TestAddSparkline(t *testing.T) {
 }
 
 func TestAppendSparkline(t *testing.T) {
-	// Test unsupport charset.
+	// Test unsupported charset.
 	f := NewFile()
 	ws, err := f.workSheetReader("Sheet1")
 	assert.NoError(t, err)

+ 1 - 1
stream.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
stream_test.go

@@ -94,7 +94,7 @@ func TestStreamWriter(t *testing.T) {
 	assert.NoError(t, streamWriter.rawData.tmp.Close())
 	assert.NoError(t, os.Remove(streamWriter.rawData.tmp.Name()))
 
-	// Test unsupport charset
+	// Test unsupported charset
 	file = NewFile()
 	delete(file.Sheet, "xl/worksheets/sheet1.xml")
 	file.XLSX["xl/worksheets/sheet1.xml"] = MacintoshCyrillicCharset

+ 1 - 1
styles.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
styles_test.go

@@ -259,7 +259,7 @@ func TestSetDefaultFont(t *testing.T) {
 
 func TestStylesReader(t *testing.T) {
 	f := NewFile()
-	// Test read styles with unsupport charset.
+	// Test read styles with unsupported charset.
 	f.Styles = nil
 	f.XLSX["xl/styles.xml"] = MacintoshCyrillicCharset
 	assert.EqualValues(t, new(xlsxStyleSheet), f.stylesReader())
@@ -267,7 +267,7 @@ func TestStylesReader(t *testing.T) {
 
 func TestThemeReader(t *testing.T) {
 	f := NewFile()
-	// Test read theme with unsupport charset.
+	// Test read theme with unsupported charset.
 	f.XLSX["xl/theme/theme1.xml"] = MacintoshCyrillicCharset
 	assert.EqualValues(t, new(xlsxTheme), f.themeReader())
 }

+ 1 - 1
table.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
templates.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
vmlDrawing.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlApp.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlCalcChain.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlChart.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlComments.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlContentTypes.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlCore.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlDecodeDrawing.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
xmlDrawing.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlPivotCache.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlPivotTable.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlSharedStrings.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlStyles.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 1 - 1
xmlTable.go

@@ -4,7 +4,7 @@
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlTheme.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlWorkbook.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.

+ 2 - 2
xmlWorksheet.go

@@ -1,10 +1,10 @@
-// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// Copyright 2016 - 2021 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.
 //
 // Package excelize providing a set of functions that allow you to write to
 // and read from XLSX / XLSM / XLTM files. Supports reading and writing
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
 // complex components by high compatibility, and provided streaming API for
 // generating or reading data from a worksheet with huge amounts of data. This
 // library needs Go version 1.10 or later.