Commit 18fc5e3f authored by jkobus's avatar jkobus Committed by Jarek Kobus
Browse files

DiffEditor: replace carriage return chars with spaces.



Make sure text block is valid before using its layout.

Task-number: QTCREATORBUG-12056
Change-Id: I618edfcf549b675282587aed577810b806692bd4
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent 49094282
......@@ -287,6 +287,9 @@ void MultiHighlighter::highlightBlock(const QString &text)
QTextBlock documentBlock = currentDocument->findBlockByNumber(
block.blockNumber() - m_editor->blockNumberForFileIndex(fileIndex));
if (!documentBlock.isValid())
return;
QList<QTextLayout::FormatRange> formats = documentBlock.layout()->additionalFormats();
setExtraAdditionalFormats(block, formats);
}
......@@ -960,6 +963,8 @@ void SideBySideDiffEditorWidget::showDiff()
blockNumber++;
}
}
leftText.replace(QChar::CarriageReturn, QChar::Space);
rightText.replace(QChar::CarriageReturn, QChar::Space);
leftTexts += leftText;
rightTexts += rightText;
leftDocs.append(qMakePair(contextFileData.leftFileInfo, leftText));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment