Skip to content

Commit 4b4d4df

Browse files
authored
This closes qax-os#2061, fix border styles missing after saved workbook (qax-os#2064)
- Using form template for GitHub issues - Typo fix for comments of the getSupportedLanguageInfo function
1 parent caf22e4 commit 4b4d4df

File tree

7 files changed

+127
-113
lines changed

7 files changed

+127
-113
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

-44
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Bug report
2+
description: Create a report to help us improve
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.
8+
9+
- type: textarea
10+
id: description
11+
attributes:
12+
label: Description
13+
description: Briefly describe the problem you are having in a few paragraphs.
14+
validations:
15+
required: true
16+
17+
- type: textarea
18+
id: reproduction-steps
19+
attributes:
20+
label: Steps to reproduce the issue
21+
description: Explain how to cause the issue in the provided reproduction.
22+
placeholder: |
23+
1.
24+
2.
25+
3.
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: received
31+
attributes:
32+
label: Describe the results you received
33+
validations:
34+
required: true
35+
36+
- type: textarea
37+
id: expected
38+
attributes:
39+
label: Describe the results you expected
40+
validations:
41+
required: true
42+
43+
- type: input
44+
id: go-version
45+
attributes:
46+
label: Go version
47+
description: |
48+
Output of `go version`:
49+
placeholder: e.g. 1.23.4
50+
validations:
51+
required: true
52+
53+
- type: input
54+
id: excelize-version
55+
attributes:
56+
label: Excelize version or commit ID
57+
description: |
58+
Which version of Excelize are you using?
59+
placeholder: e.g. 2.9.0
60+
validations:
61+
required: true
62+
63+
- type: textarea
64+
id: env
65+
attributes:
66+
label: Environment
67+
description: Environment details (OS, Microsoft Excel™ version, physical, etc.)
68+
render: shell
69+
validations:
70+
required: true
71+
72+
- type: checkboxes
73+
id: checkboxes
74+
attributes:
75+
label: Validations
76+
description: Before submitting the issue, please make sure you do the following
77+
options:
78+
- label: Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
79+
required: true
80+
- label: The provided reproduction is a minimal reproducible example of the bug.
81+
required: true

.github/ISSUE_TEMPLATE/feature_request.md

-44
This file was deleted.
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Feature request
2+
description: Suggest an idea for this project
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.
8+
9+
- type: textarea
10+
id: description
11+
attributes:
12+
label: Description
13+
description: Describe the feature that you would like added
14+
validations:
15+
required: true
16+
17+
- type: textarea
18+
id: additional-context
19+
attributes:
20+
label: Additional context
21+
description: Any other context or screenshots about the feature request here?
22+
23+
- type: checkboxes
24+
id: checkboxes
25+
attributes:
26+
label: Validations
27+
description: Before submitting the issue, please make sure you do the following
28+
options:
29+
- label: Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.
30+
required: true

numfmt.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4661,7 +4661,7 @@ var (
46614661
}
46624662
)
46634663

4664-
// getSupportedLanguageInfo returns language infomation by giving language code.
4664+
// getSupportedLanguageInfo returns language information by giving language code.
46654665
// This function does not support different calendar type of the language
46664666
// currently. For example: the hexadecimal language code 3010429 (fa-IR,301)
46674667
// will be convert to 0429 (fa-IR).

styles.go

+10-19
Original file line numberDiff line numberDiff line change
@@ -1441,16 +1441,16 @@ func (f *File) getThemeColor(clr *xlsxColor) string {
14411441
func (f *File) extractBorders(bdr *xlsxBorder, s *xlsxStyleSheet, style *Style) {
14421442
if bdr != nil {
14431443
var borders []Border
1444-
extractBorder := func(lineType string, line xlsxLine) {
1445-
if line.Style != "" {
1444+
extractBorder := func(lineType string, line *xlsxLine) {
1445+
if line != nil && line.Style != "" {
14461446
borders = append(borders, Border{
14471447
Type: lineType,
14481448
Color: f.getThemeColor(line.Color),
14491449
Style: inStrSlice(styleBorders, line.Style, false),
14501450
})
14511451
}
14521452
}
1453-
for i, line := range []xlsxLine{
1453+
for i, line := range []*xlsxLine{
14541454
bdr.Left, bdr.Right, bdr.Top, bdr.Bottom, bdr.Diagonal, bdr.Diagonal,
14551455
} {
14561456
if i < 4 {
@@ -2128,29 +2128,20 @@ func newBorders(style *Style) *xlsxBorder {
21282128
var border xlsxBorder
21292129
for _, v := range style.Border {
21302130
if 0 <= v.Style && v.Style < 14 {
2131-
var color xlsxColor
2132-
color.RGB = getPaletteColor(v.Color)
2131+
line := &xlsxLine{Style: styleBorders[v.Style], Color: &xlsxColor{RGB: getPaletteColor(v.Color)}}
21332132
switch v.Type {
21342133
case "left":
2135-
border.Left.Style = styleBorders[v.Style]
2136-
border.Left.Color = &color
2134+
border.Left = line
21372135
case "right":
2138-
border.Right.Style = styleBorders[v.Style]
2139-
border.Right.Color = &color
2136+
border.Right = line
21402137
case "top":
2141-
border.Top.Style = styleBorders[v.Style]
2142-
border.Top.Color = &color
2138+
border.Top = line
21432139
case "bottom":
2144-
border.Bottom.Style = styleBorders[v.Style]
2145-
border.Bottom.Color = &color
2140+
border.Bottom = line
21462141
case "diagonalUp":
2147-
border.Diagonal.Style = styleBorders[v.Style]
2148-
border.Diagonal.Color = &color
2149-
border.DiagonalUp = true
2142+
border.Diagonal, border.DiagonalUp = line, true
21502143
case "diagonalDown":
2151-
border.Diagonal.Style = styleBorders[v.Style]
2152-
border.Diagonal.Color = &color
2153-
border.DiagonalDown = true
2144+
border.Diagonal, border.DiagonalDown = line, true
21542145
}
21552146
}
21562147
}

xmlStyles.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ type xlsxBorder struct {
162162
DiagonalDown bool `xml:"diagonalDown,attr,omitempty"`
163163
DiagonalUp bool `xml:"diagonalUp,attr,omitempty"`
164164
Outline bool `xml:"outline,attr,omitempty"`
165-
Left xlsxLine `xml:"left"`
166-
Right xlsxLine `xml:"right"`
167-
Top xlsxLine `xml:"top"`
168-
Bottom xlsxLine `xml:"bottom"`
169-
Diagonal xlsxLine `xml:"diagonal"`
165+
Left *xlsxLine `xml:"left"`
166+
Right *xlsxLine `xml:"right"`
167+
Top *xlsxLine `xml:"top"`
168+
Bottom *xlsxLine `xml:"bottom"`
169+
Diagonal *xlsxLine `xml:"diagonal"`
170170
Vertical *xlsxLine `xml:"vertical"`
171171
Horizontal *xlsxLine `xml:"horizontal"`
172172
}

0 commit comments

Comments
 (0)