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

Update adjustFormula #1698

Merged
merged 4 commits into from
Oct 23, 2023
Merged

Update adjustFormula #1698

merged 4 commits into from
Oct 23, 2023

Conversation

TeeRenJing
Copy link
Contributor

PR Details

Update adjustFormula function to take in another parameter to track position of row/column inserted.
Then with the excel formula parser, we can update the coordinates of the affected formula references.

Description

Added an extra parameter positionInserted so that we can do a comparison as to which reference needs to be updated by the offset.

Related Issue

#1615

Motivation and Context

So that when rows/columns are inserted, formula references are updated automatically as per the behaviour in Excel.

How Has This Been Tested

Also updated TestAdjustFormula in adjust_test.go to reflect the formula references auto updating.

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.

TeeRenJing and others added 3 commits October 23, 2023 15:01
@xuri xuri added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 23, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2023

Codecov Report

Merging #1698 (81c5fc0) into master (05689d6) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@           Coverage Diff           @@
##           master    #1698   +/-   ##
=======================================
  Coverage   99.02%   99.02%           
=======================================
  Files          32       32           
  Lines       27745    27818   +73     
=======================================
+ Hits        27475    27548   +73     
  Misses        179      179           
  Partials       91       91           
Flag Coverage Δ
unittests 99.02% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
adjust.go 99.22% <100.00%> (+0.17%) ⬆️
calc.go 99.25% <100.00%> (ø)
lib.go 98.46% <100.00%> (+<0.01%) ⬆️
rows.go 97.67% <100.00%> (ø)

- Support adjust formula on inserting/deleting columns/rows
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. I have made some changes based on your branch. This feature will be released in the next version.

@xuri xuri merged commit a8cbcfa into qax-os:master Oct 23, 2023
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants