mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #281] worksheet_merge_range might produce a corrupt file #223
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#223
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @znakeeye on GitHub (Apr 1, 2020).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/281
Originally assigned to: @jmcnamara on GitHub.
I want to create this:
So I tried this:
Then when opening the file Excel complains. Shouldn't
libxlsxwriterbe able to detect this error?It seems impossible to create this cell pattern using the merge API. Ideas?
@znakeeye commented on GitHub (Apr 1, 2020):
I can get the pattern if I change the last merge call to:
Do you think it is up to the developer to handle this? Or should the merge method have a special case where it internally calls
worksheet_write_string(self, first_row, last_col, string, format)forfirst_row == last_row?@znakeeye commented on GitHub (Apr 1, 2020):
The more I think of it, I believe that
worksheet_merge_rangeshould return some new error code for this overlapping issue. That way we can take action should the error occur.It's very hard to detect this condition before calling the method. You would have to maintain a dictionary of added merge ranges and check if the new merge would overlap.
@znakeeye commented on GitHub (Apr 1, 2020):
I guess overlap-detection would be quite costly? Certainly don't want to reduce performance.
@jmcnamara commented on GitHub (Apr 1, 2020):
I think you worked out all the answers here yourself: