summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/ISSUE_TEMPLATE.md6
-rw-r--r--CONTRIBUTING.md19
-rw-r--r--excelize_test.go3
-rw-r--r--sheet.go20
4 files changed, 29 insertions, 19 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index d93dd0d..5d7e931 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -21,19 +21,17 @@ Briefly describe the problem you are having in a few paragraphs.
**Describe the results you received:**
-
**Describe the results you expected:**
-
**Output of `go version`:**
-```
+```text
(paste your output here)
```
**Excelize version or commit ID:**
-```
+```text
(paste here)
```
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 27705c8..5239a94 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,7 +25,6 @@ Security reports are greatly appreciated and we will publicly thank you for it.
We currently do not offer a paid security bounty program, but are not
ruling it out in the future.
-
## Reporting other issues
A great way to contribute to the project is to send a detailed report when you
@@ -44,7 +43,7 @@ When reporting issues, always include the output of `go env`.
Also include the steps required to reproduce the problem if possible and
applicable. This information will help us review and fix your issue faster.
-When sending lengthy log-files, consider posting them as a gist (https://gist.github.com).
+When sending lengthy log-files, consider posting them as a gist [https://gist.github.com](https://gist.github.com).
Don't forget to remove sensitive data from your logfiles before posting (you can
replace those parts with "REDACTED").
@@ -77,9 +76,9 @@ However, there might be a way to implement that feature *on top of* excelize.
Fork the repository and make changes on your fork in a feature branch:
-- If it's a bug fix branch, name it XXXX-something where XXXX is the number of
+* If it's a bug fix branch, name it XXXX-something where XXXX is the number of
the issue.
-- If it's a feature branch, create an enhancement issue to announce
+* If it's a feature branch, create an enhancement issue to announce
your intentions, and name it XXXX-something where XXXX is the number of the
issue.
@@ -194,7 +193,7 @@ signature certifies that you wrote the patch or otherwise have the right to pass
it on as an open-source patch. The rules are pretty simple: if you can certify
the below (from [developercertificate.org](http://developercertificate.org/)):
-```
+```text
Developer Certificate of Origin
Version 1.1
@@ -242,14 +241,14 @@ Use your real name (sorry, no pseudonyms or anonymous contributions.)
If you set your `user.name` and `user.email` git configs, you can sign your
commit automatically with `git commit -s`.
-### How can I become a maintainer?
+### How can I become a maintainer
First, all maintainers have 3 things
-- They share responsibility in the project's success.
-- They have made a long-term, recurring time investment to improve the project.
-- They spend that time doing whatever needs to be done, not necessarily what
-is the most interesting or fun.
+* They share responsibility in the project's success.
+* They have made a long-term, recurring time investment to improve the project.
+* They spend that time doing whatever needs to be done, not necessarily what
+ is the most interesting or fun.
Maintainers are often under-appreciated, because their work is harder to appreciate.
It's easy to appreciate a really cool and technically advanced feature. It's harder
diff --git a/excelize_test.go b/excelize_test.go
index df1b35a..f1f23b4 100644
--- a/excelize_test.go
+++ b/excelize_test.go
@@ -85,6 +85,9 @@ func TestOpenFile(t *testing.T) {
xlsx.SetCellValue("Sheet2", "F17", complex64(5+10i))
t.Log(letterOnlyMapF('x'))
t.Log(deepCopy(nil, nil))
+ shiftJulianToNoon(1, -0.6)
+ timeFromExcelTime(61, true)
+ timeFromExcelTime(62, true)
// Test boolean write
booltest := []struct {
value bool
diff --git a/sheet.go b/sheet.go
index 10a0fdb..cb3bba2 100644
--- a/sheet.go
+++ b/sheet.go
@@ -94,13 +94,15 @@ func (f *File) worksheetWriter() {
// trimCell provides function to trim blank cells which created by completeCol.
func trimCell(column []xlsxC) []xlsxC {
- col := []xlsxC{}
+ col := make([]xlsxC, len(column))
+ i := 0
for _, c := range column {
if c.S != 0 || c.V != "" || c.F != nil || c.T != "" {
- col = append(col, c)
+ col[i] = c
+ i++
}
}
- return col
+ return col[0:i]
}
// Read and update property of contents type of XLSX.
@@ -641,8 +643,16 @@ func (f *File) GetSheetVisible(name string) bool {
// trimSheetName provides function to trim invaild characters by given worksheet
// name.
func trimSheetName(name string) string {
- r := strings.NewReplacer(":", "", "\\", "", "/", "", "?", "", "*", "", "[", "", "]", "")
- name = r.Replace(name)
+ r := []rune{}
+ for _, v := range []rune(name) {
+ switch v {
+ case 58, 92, 47, 63, 42, 91, 93: // replace :\/?*[]
+ continue
+ default:
+ r = append(r, v)
+ }
+ }
+ name = string(r)
if utf8.RuneCountInString(name) > 31 {
name = string([]rune(name)[0:31])
}