Skip to content

Fix issues with updating Conditional Formatting when inserting/deleting rows/columns #2689

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

Merged

Conversation

MarkBaker
Copy link
Member

@MarkBaker MarkBaker commented Mar 17, 2022

This is:

- [X] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

Fix issues with updating Conditional Formatting when inserting/deleting rows/columns

  • Update existing ranges, expanding or reducing if necessary, rather than trying to clone the CF for each individual cell.

    This is also better for memory usage, with fewer CF rules and styles being maintained

  • Update conditions, so that cell references and formulae are maintained correctly.

Note that absolute as well as relative cell references should be updated in conditions


This is a the third and final step toward allowing updates to absolute cell references, required to update Conditional Formatting rules when columns/rows are inserted/deleted as highlighted by Issue #2678; the final step in a multi-step process.

Step 1
Refactor the cell reference update logic to make it easier to modify, and to test the planned modifications
This may also make the code more performant, as it allows elimination of a lot of code duplication in the different methods to update different components of the worksheet. PR #2682

Step 2
Modify the cell reference update logic to accept a flag indicating whether it should update absolute as well as relative cell references PR #2685

Step 3
Add the logic to update Conditional Formatting ranges and rules when inserting/deleting rows/columns

@MarkBaker MarkBaker changed the title Fix issues with updating Conditional Formatting wen inserting/deleting rows/columns Fix issues with updating Conditional Formatting when inserting/deleting rows/columns Mar 17, 2022
…ng rows/columns

 - Update existing ranges, expanding if necessary, rather than trying to clone for each individual cell
 - Update conditions, so that cell references and formulae are maintained correctly

Note that absolute as well as relative cell references should be updated in conditions
@MarkBaker MarkBaker force-pushed the Issue-2678_Update-CF-Ranges-and-Conditions-on-Insert/Delete branch from 50fa09b to 6faf828 Compare March 17, 2022 10:37
@MarkBaker MarkBaker merged commit 178f748 into master Mar 17, 2022
@MarkBaker MarkBaker deleted the Issue-2678_Update-CF-Ranges-and-Conditions-on-Insert/Delete branch March 17, 2022 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant