Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1299 don't write nil values in SetRow #1301

Merged
merged 1 commit into from
Aug 4, 2022

Conversation

thomascharbonnel
Copy link
Contributor

PR Details

In SetRow, ignore nil values when writing to XML file.

Description

  • In SetRow, skip nil values when writing
  • Add a test to enforce this behavior

Related Issue

#1299

Motivation and Context

Before this change, when setting nil values using SetRow, Excelize would create empty <c> elements. These elements are seen by Excel as separate cells with a style separate from the row-level style. Which breaks row-level styling.

How Has This Been Tested

A test was added to check the parsed XML output.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-commenter
Copy link

codecov-commenter commented Aug 3, 2022

Codecov Report

Merging #1301 (b133399) into master (504d469) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1301   +/-   ##
=======================================
  Coverage   98.47%   98.47%           
=======================================
  Files          31       31           
  Lines       23446    23448    +2     
=======================================
+ Hits        23088    23090    +2     
  Misses        239      239           
  Partials      119      119           
Flag Coverage Δ
unittests 98.47% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
stream.go 89.56% <100.00%> (+0.05%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@xuri xuri added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 4, 2022
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contribution.

@xuri xuri merged commit 4a029f7 into qax-os:master Aug 4, 2022
xuri pushed a commit to carbin-gun/excelize that referenced this pull request Oct 9, 2022
xuri pushed a commit to JDavidVR/excelize that referenced this pull request Jul 11, 2023
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this pull request Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants