value fields xlsxPatternFill.FgColor & xlsxPatternFill.BgColor cause … #770
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Value fields
xlsxPatternFill.FgColor
&xlsxPatternFill.BgColor
cause ineffectiveomitempty
tagsPR Details
omitempty
tag is used at fieldsxlsxPatternFill.FgColor
andxlsxPatternFill.BgColor
, but they are bothvalue fields
but notpointer fields
, which means they are not ignored while xml marshaling.So I fixed it to
pointer fields
.Description
Below is defined at ECMA-376:
fgColor is used for solid cell, and fgColor is used for cell filled with color.
Tag
omitempty
is used to ignore color elements not in need, where theBgColor
andFgColor
are bothvalue fields
but notpointer fields
. It means blank xml element will be built.sample in standard styles.xml:
sample in excelize styles.xml:
So what? Files with useless
color elements
may be not rendered normally in Google Sheets.Related Issue
#769
Motivation and Context
How Has This Been Tested
I wrote a sample code to build test xlsx files. Files built with new code work well in both Google Sheets and MS Office.
Types of changes
Checklist