Address cppcheck

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
jpirnay
2026-04-23 22:14:41 +02:00
co-authored by Copilot
parent e968a54e77
commit c04153ec5a
+3 -5
View File
@@ -359,12 +359,12 @@ bool MdReaderActivity::wordWrapParsedLine(const MdParser::ParsedLine& parsed, in
} }
// Word-wrap across spans // Word-wrap across spans
const int continuationIndent = indent + listPrefixIndent;
RenderedLine currentLine; RenderedLine currentLine;
currentLine.indent = indent; currentLine.indent = indent;
currentLine.isCodeBlock = isCodeBlock; currentLine.isCodeBlock = isCodeBlock;
int currentWidth = 0; int currentWidth = 0;
bool fullyConsumed = true; bool fullyConsumed = true;
bool firstLine = true;
for (size_t si = 0; si < allSpans.size(); si++) { for (size_t si = 0; si < allSpans.size(); si++) {
const auto& span = allSpans[si]; const auto& span = allSpans[si];
@@ -421,9 +421,8 @@ bool MdReaderActivity::wordWrapParsedLine(const MdParser::ParsedLine& parsed, in
} }
} else { } else {
outLines.push_back(std::move(currentLine)); outLines.push_back(std::move(currentLine));
firstLine = false;
currentLine = RenderedLine(); currentLine = RenderedLine();
currentLine.indent = indent + (firstLine ? 0 : listPrefixIndent); currentLine.indent = continuationIndent;
currentLine.isCodeBlock = isCodeBlock; currentLine.isCodeBlock = isCodeBlock;
currentWidth = 0; currentWidth = 0;
continue; continue;
@@ -432,9 +431,8 @@ bool MdReaderActivity::wordWrapParsedLine(const MdParser::ParsedLine& parsed, in
currentLine.spans.push_back({remaining.substr(0, breakPos), style}); currentLine.spans.push_back({remaining.substr(0, breakPos), style});
outLines.push_back(std::move(currentLine)); outLines.push_back(std::move(currentLine));
firstLine = false;
currentLine = RenderedLine(); currentLine = RenderedLine();
currentLine.indent = indent + (firstLine ? 0 : listPrefixIndent); currentLine.indent = continuationIndent;
currentLine.isCodeBlock = isCodeBlock; currentLine.isCodeBlock = isCodeBlock;
currentWidth = 0; currentWidth = 0;