Repository navigation
Refuse inserting cells that would push values off the worksheet (#580) - #584
Merged
Merged
Conversation
MarekSpodBiedry
marked this pull request as ready for review
October 12, 2026 06:53
Contributor
|
The old-base CSV failures are addressed by incorporating the existing upstream fix, while preserving your worksheet-boundary insertion guard and regression tests. The refreshed source passed all eight Ubuntu Follow-up to your existing branch: MarekSpodBiedry#5 (commit |
jesusthehelper-oss
added a commit
to jesusthehelper-oss/gridcraft
that referenced
this pull request
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #580.
home.insertCellswithshift: "right"or"down"moved the cells and quietly dropped any cell that landed past column XFD or row 1048576 (shift_cols_in_rows/shift_rows_in_colskeep only moved cells that are still on the sheet). In the issue's repro, a value in XFD1 or A1048576 was lost after inserting at A1, and the saved file did not have it either.Before it edits anything,
insert_cellsnow checks the cells that would be pushed off: the lastwidthcolumns of the affected rows (shift right) or the lastheightrows of the affected columns (shift down), but only from the inserted range onward. If any of them has a value or a formula, the command fails and the workbook stays unchanged. The error text is the same "To prevent possible loss of data, Excel cannot shift nonblank cells off of the worksheet." message thatinsert_linesalready uses for whole rows and columns. The table-header insert ininsert.rsmakes the same nonblank check (value or formula). Values that still fit move as before, and the entire-row/entire-column shift modes still go throughinsert_lines.Test
inserting_cells_refuses_to_push_values_off_the_sheetincrates/engine/src/tests.rscovers both directions with the issue's fixtures: