Fix Document::saveAs with QSaveFile - #469
Open
lite-tx wants to merge 2 commits into
Open
Conversation
|
lite-tx
marked this pull request as ready for review
July 24, 2026 15:56
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.



Summary
QSaveFileownership while allowingQZipWriterto finalize the ZIP archiveQIODeviceimplementationsQSaveFileafterDocument::saveAs()QZipWriter::close()must be called to write the ZIP central directory, but it also unconditionally closes its device. Closing aQSaveFileaborts the process because it must be finalized withcommit(). The new proxy forwards I/O and seek operations while intercepting onlyclose(), so the caller can commit the completed workbook atomically.Verification
QSaveFile::close calledfatal exit on currentmasterQSaveFileinstances can save, remain open, commit, and be read backQFileandQBufferclose behavior and workbook read-backzipfile -tTestExcelthrough qmake/nmakeFixes #443