Skip to content

Commit 2245fcc

Browse files
committed
Typo fix, rename exported constants, dependencies modules and copyright update
Rename exported constants `NameSpaceDublinCoreMetadataIntiative` to `NameSpaceDublinCoreMetadataInitiative`
1 parent af5c4d0 commit 2245fcc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+220
-224
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2016-2021 The excelize Authors.
3+
Copyright (c) 2016-2022 The excelize Authors.
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

adjust.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//
@@ -81,13 +81,13 @@ func (f *File) adjustRowDimensions(ws *xlsxWorksheet, row, offset int) {
8181
for i := range ws.SheetData.Row {
8282
r := &ws.SheetData.Row[i]
8383
if newRow := r.R + offset; r.R >= row && newRow > 0 {
84-
f.ajustSingleRowDimensions(r, newRow)
84+
f.adjustSingleRowDimensions(r, newRow)
8585
}
8686
}
8787
}
8888

89-
// ajustSingleRowDimensions provides a function to ajust single row dimensions.
90-
func (f *File) ajustSingleRowDimensions(r *xlsxRow, num int) {
89+
// adjustSingleRowDimensions provides a function to adjust single row dimensions.
90+
func (f *File) adjustSingleRowDimensions(r *xlsxRow, num int) {
9191
r.R = num
9292
for i, col := range r.C {
9393
colName, _, _ := SplitCellName(col.R)

adjust_test.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestAdjustMergeCells(t *testing.T) {
4848

4949
// testing adjustMergeCells
5050
var cases []struct {
51-
lable string
51+
label string
5252
ws *xlsxWorksheet
5353
dir adjustDirection
5454
num int
@@ -58,15 +58,15 @@ func TestAdjustMergeCells(t *testing.T) {
5858

5959
// testing insert
6060
cases = []struct {
61-
lable string
61+
label string
6262
ws *xlsxWorksheet
6363
dir adjustDirection
6464
num int
6565
offset int
6666
expect string
6767
}{
6868
{
69-
lable: "insert row on ref",
69+
label: "insert row on ref",
7070
ws: &xlsxWorksheet{
7171
MergeCells: &xlsxMergeCells{
7272
Cells: []*xlsxMergeCell{
@@ -82,7 +82,7 @@ func TestAdjustMergeCells(t *testing.T) {
8282
expect: "A3:B4",
8383
},
8484
{
85-
lable: "insert row on bottom of ref",
85+
label: "insert row on bottom of ref",
8686
ws: &xlsxWorksheet{
8787
MergeCells: &xlsxMergeCells{
8888
Cells: []*xlsxMergeCell{
@@ -98,7 +98,7 @@ func TestAdjustMergeCells(t *testing.T) {
9898
expect: "A2:B4",
9999
},
100100
{
101-
lable: "insert column on the left",
101+
label: "insert column on the left",
102102
ws: &xlsxWorksheet{
103103
MergeCells: &xlsxMergeCells{
104104
Cells: []*xlsxMergeCell{
@@ -116,20 +116,20 @@ func TestAdjustMergeCells(t *testing.T) {
116116
}
117117
for _, c := range cases {
118118
assert.NoError(t, f.adjustMergeCells(c.ws, c.dir, c.num, 1))
119-
assert.Equal(t, c.expect, c.ws.MergeCells.Cells[0].Ref, c.lable)
119+
assert.Equal(t, c.expect, c.ws.MergeCells.Cells[0].Ref, c.label)
120120
}
121121

122122
// testing delete
123123
cases = []struct {
124-
lable string
124+
label string
125125
ws *xlsxWorksheet
126126
dir adjustDirection
127127
num int
128128
offset int
129129
expect string
130130
}{
131131
{
132-
lable: "delete row on top of ref",
132+
label: "delete row on top of ref",
133133
ws: &xlsxWorksheet{
134134
MergeCells: &xlsxMergeCells{
135135
Cells: []*xlsxMergeCell{
@@ -145,7 +145,7 @@ func TestAdjustMergeCells(t *testing.T) {
145145
expect: "A2:B2",
146146
},
147147
{
148-
lable: "delete row on bottom of ref",
148+
label: "delete row on bottom of ref",
149149
ws: &xlsxWorksheet{
150150
MergeCells: &xlsxMergeCells{
151151
Cells: []*xlsxMergeCell{
@@ -161,7 +161,7 @@ func TestAdjustMergeCells(t *testing.T) {
161161
expect: "A2:B2",
162162
},
163163
{
164-
lable: "delete column on the ref left",
164+
label: "delete column on the ref left",
165165
ws: &xlsxWorksheet{
166166
MergeCells: &xlsxMergeCells{
167167
Cells: []*xlsxMergeCell{
@@ -177,7 +177,7 @@ func TestAdjustMergeCells(t *testing.T) {
177177
expect: "A2:A3",
178178
},
179179
{
180-
lable: "delete column on the ref right",
180+
label: "delete column on the ref right",
181181
ws: &xlsxWorksheet{
182182
MergeCells: &xlsxMergeCells{
183183
Cells: []*xlsxMergeCell{
@@ -195,20 +195,20 @@ func TestAdjustMergeCells(t *testing.T) {
195195
}
196196
for _, c := range cases {
197197
assert.NoError(t, f.adjustMergeCells(c.ws, c.dir, c.num, -1))
198-
assert.Equal(t, c.expect, c.ws.MergeCells.Cells[0].Ref, c.lable)
198+
assert.Equal(t, c.expect, c.ws.MergeCells.Cells[0].Ref, c.label)
199199
}
200200

201201
// testing delete one row/column
202202
cases = []struct {
203-
lable string
203+
label string
204204
ws *xlsxWorksheet
205205
dir adjustDirection
206206
num int
207207
offset int
208208
expect string
209209
}{
210210
{
211-
lable: "delete one row ref",
211+
label: "delete one row ref",
212212
ws: &xlsxWorksheet{
213213
MergeCells: &xlsxMergeCells{
214214
Cells: []*xlsxMergeCell{
@@ -223,7 +223,7 @@ func TestAdjustMergeCells(t *testing.T) {
223223
offset: -1,
224224
},
225225
{
226-
lable: "delete one column ref",
226+
label: "delete one column ref",
227227
ws: &xlsxWorksheet{
228228
MergeCells: &xlsxMergeCells{
229229
Cells: []*xlsxMergeCell{
@@ -240,7 +240,7 @@ func TestAdjustMergeCells(t *testing.T) {
240240
}
241241
for _, c := range cases {
242242
assert.NoError(t, f.adjustMergeCells(c.ws, c.dir, c.num, -1))
243-
assert.Equal(t, 0, len(c.ws.MergeCells.Cells), c.lable)
243+
assert.Equal(t, 0, len(c.ws.MergeCells.Cells), c.label)
244244
}
245245

246246
f = NewFile()

calc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//

calcchain.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//
@@ -25,7 +25,7 @@ func (f *File) calcChainReader() *xlsxCalcChain {
2525

2626
if f.CalcChain == nil {
2727
f.CalcChain = new(xlsxCalcChain)
28-
if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(dafaultXMLPathCalcChain)))).
28+
if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(defaultXMLPathCalcChain)))).
2929
Decode(f.CalcChain); err != nil && err != io.EOF {
3030
log.Printf("xml decode error: %s", err)
3131
}
@@ -39,7 +39,7 @@ func (f *File) calcChainReader() *xlsxCalcChain {
3939
func (f *File) calcChainWriter() {
4040
if f.CalcChain != nil && f.CalcChain.C != nil {
4141
output, _ := xml.Marshal(f.CalcChain)
42-
f.saveFileList(dafaultXMLPathCalcChain, output)
42+
f.saveFileList(defaultXMLPathCalcChain, output)
4343
}
4444
}
4545

@@ -54,7 +54,7 @@ func (f *File) deleteCalcChain(index int, axis string) {
5454
}
5555
if len(calc.C) == 0 {
5656
f.CalcChain = nil
57-
f.Pkg.Delete(dafaultXMLPathCalcChain)
57+
f.Pkg.Delete(defaultXMLPathCalcChain)
5858
content := f.contentTypesReader()
5959
content.Lock()
6060
defer content.Unlock()

calcchain_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import "testing"
55
func TestCalcChainReader(t *testing.T) {
66
f := NewFile()
77
f.CalcChain = nil
8-
f.Pkg.Store(dafaultXMLPathCalcChain, MacintoshCyrillicCharset)
8+
f.Pkg.Store(defaultXMLPathCalcChain, MacintoshCyrillicCharset)
99
f.calcChainReader()
1010
}
1111

cell.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//
@@ -372,9 +372,9 @@ func (f *File) setCellString(value string) (t, v string, err error) {
372372
func (f *File) sharedStringsLoader() (err error) {
373373
f.Lock()
374374
defer f.Unlock()
375-
if path, ok := f.tempFiles.Load(dafaultXMLPathSharedStrings); ok {
376-
f.Pkg.Store(dafaultXMLPathSharedStrings, f.readBytes(dafaultXMLPathSharedStrings))
377-
f.tempFiles.Delete(dafaultXMLPathSharedStrings)
375+
if path, ok := f.tempFiles.Load(defaultXMLPathSharedStrings); ok {
376+
f.Pkg.Store(defaultXMLPathSharedStrings, f.readBytes(defaultXMLPathSharedStrings))
377+
f.tempFiles.Delete(defaultXMLPathSharedStrings)
378378
err = os.Remove(path.(string))
379379
f.SharedStrings, f.sharedStringItemMap = nil, nil
380380
}
@@ -455,7 +455,7 @@ func (f *File) GetCellFormula(sheet, axis string) (string, error) {
455455
return "", false, nil
456456
}
457457
if c.F.T == STCellFormulaTypeShared && c.F.Si != nil {
458-
return getSharedForumula(x, *c.F.Si, c.R), true, nil
458+
return getSharedFormula(x, *c.F.Si, c.R), true, nil
459459
}
460460
return c.F.Content, true, nil
461461
})
@@ -621,7 +621,7 @@ func (ws *xlsxWorksheet) countSharedFormula() (count int) {
621621
}
622622

623623
// GetCellHyperLink provides a function to get cell hyperlink by given
624-
// worksheet name and axis. Boolean type value link will be ture if the cell
624+
// worksheet name and axis. Boolean type value link will be true if the cell
625625
// has a hyperlink and the target is the address of the hyperlink. Otherwise,
626626
// the value of link will be false and the value of the target will be a blank
627627
// string. For example get hyperlink of Sheet1!H6:
@@ -1232,15 +1232,15 @@ func parseSharedFormula(dCol, dRow int, orig []byte) (res string, start int) {
12321232
return
12331233
}
12341234

1235-
// getSharedForumula find a cell contains the same formula as another cell,
1235+
// getSharedFormula find a cell contains the same formula as another cell,
12361236
// the "shared" value can be used for the t attribute and the si attribute can
12371237
// be used to refer to the cell containing the formula. Two formulas are
12381238
// considered to be the same when their respective representations in
12391239
// R1C1-reference notation, are the same.
12401240
//
12411241
// Note that this function not validate ref tag to check the cell if or not in
12421242
// allow area, and always return origin shared formula.
1243-
func getSharedForumula(ws *xlsxWorksheet, si int, axis string) string {
1243+
func getSharedFormula(ws *xlsxWorksheet, si int, axis string) string {
12441244
for _, r := range ws.SheetData.Row {
12451245
for _, c := range r.C {
12461246
if c.F != nil && c.F.Ref != "" && c.F.T == STCellFormulaTypeShared && c.F.Si != nil && *c.F.Si == si {

cell_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -653,14 +653,14 @@ func TestFormattedValue2(t *testing.T) {
653653
func TestSharedStringsError(t *testing.T) {
654654
f, err := OpenFile(filepath.Join("test", "Book1.xlsx"), Options{UnzipXMLSizeLimit: 128})
655655
assert.NoError(t, err)
656-
f.tempFiles.Store(dafaultXMLPathSharedStrings, "")
656+
f.tempFiles.Store(defaultXMLPathSharedStrings, "")
657657
assert.Equal(t, "1", f.getFromStringItemMap(1))
658658

659659
// Test reload the file error on set cell cell and rich text. The error message was different between macOS and Windows.
660660
err = f.SetCellValue("Sheet1", "A19", "A19")
661661
assert.Error(t, err)
662662

663-
f.tempFiles.Store(dafaultXMLPathSharedStrings, "")
663+
f.tempFiles.Store(defaultXMLPathSharedStrings, "")
664664
err = f.SetCellRichText("Sheet1", "A19", []RichTextRun{})
665665
assert.Error(t, err)
666666

chart.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//

col.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//

comment.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//

comment_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//

crypt.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//

crypt_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//

datavalidation.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//

datavalidation_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//

date.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
1+
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
22
// this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44
//

0 commit comments

Comments
 (0)