Previously, QXmlStreamWriter would incorrectly insert a newline before the first token when writeStartDocument() was not used, while auto-formatting was enabled. This fix ensures that the first token is written inline without an extra leading newline, while preserving expected formatting for subsequent tokens. To achieve this, two new flags have been introduced: - didWriteStartDocument: Tracks whether writeStartDocument() was called. - didWriteAnyToken: Ensures that at least one token has been written before allowing newlines. Fixes: QTBUG-28721 Pick-to: 6.8 Change-Id: I8be7e8fc6ac0e63304359d24c6c8372e5ba42bb4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit c3295bd59cb1c3b858b6a858aba4481adeea209b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%