diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-09-26 14:49:52 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-09-28 15:48:16 +0000 |
commit | a1c4d563a19f464969407ccdb1f3e5b79da25c55 (patch) | |
tree | 0f9cf8849a5eb633e63f1decbf027991b0e66fd2 /src/plugins/diffeditor/diffeditorplugin.cpp | |
parent | cd8ff54b008d775df19a607f203ef2ac1655d4bc (diff) | |
download | qt-creator-a1c4d563a19f464969407ccdb1f3e5b79da25c55.tar.gz |
DiffEditor: Use DiffSide enum inside RowData
Change-Id: I5511e443e2f76a1dab5cc78eec5faec04ee31bcc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/diffeditor/diffeditorplugin.cpp')
-rw-r--r-- | src/plugins/diffeditor/diffeditorplugin.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp index 7fb8abcbac..4d08726560 100644 --- a/src/plugins/diffeditor/diffeditorplugin.cpp +++ b/src/plugins/diffeditor/diffeditorplugin.cpp @@ -851,10 +851,10 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch() const RowData &sourceRowData = sourceChunk.rows.at(k); const RowData &resultRowData = resultChunkData.rows.at(k); QCOMPARE(resultRowData.equal, sourceRowData.equal); - QCOMPARE(resultRowData.leftLine.text, sourceRowData.leftLine.text); - QCOMPARE(resultRowData.leftLine.textLineType, sourceRowData.leftLine.textLineType); - QCOMPARE(resultRowData.rightLine.text, sourceRowData.rightLine.text); - QCOMPARE(resultRowData.rightLine.textLineType, sourceRowData.rightLine.textLineType); + QCOMPARE(resultRowData.line[LeftSide].text, sourceRowData.line[LeftSide].text); + QCOMPARE(resultRowData.line[LeftSide].textLineType, sourceRowData.line[LeftSide].textLineType); + QCOMPARE(resultRowData.line[RightSide].text, sourceRowData.line[RightSide].text); + QCOMPARE(resultRowData.line[RightSide].textLineType, sourceRowData.line[RightSide].textLineType); } } } @@ -1429,10 +1429,10 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch() const RowData &origRowData = origChunkData.rows.at(k); const RowData &resultRowData = resultChunkData.rows.at(k); QCOMPARE(resultRowData.equal, origRowData.equal); - QCOMPARE(resultRowData.leftLine.text, origRowData.leftLine.text); - QCOMPARE(resultRowData.leftLine.textLineType, origRowData.leftLine.textLineType); - QCOMPARE(resultRowData.rightLine.text, origRowData.rightLine.text); - QCOMPARE(resultRowData.rightLine.textLineType, origRowData.rightLine.textLineType); + QCOMPARE(resultRowData.line[LeftSide].text, origRowData.line[LeftSide].text); + QCOMPARE(resultRowData.line[LeftSide].textLineType, origRowData.line[LeftSide].textLineType); + QCOMPARE(resultRowData.line[RightSide].text, origRowData.line[RightSide].text); + QCOMPARE(resultRowData.line[RightSide].textLineType, origRowData.line[RightSide].textLineType); } } } @@ -1457,10 +1457,10 @@ void DiffEditor::Internal::DiffEditorPlugin::testFilterPatch_data() auto appendRow = [](ChunkData *chunk, const QString &left, const QString &right) { RowData row; row.equal = (left == right); - row.leftLine.text = left; - row.leftLine.textLineType = left.isEmpty() ? TextLineData::Separator : TextLineData::TextLine; - row.rightLine.text = right; - row.rightLine.textLineType = right.isEmpty() ? TextLineData::Separator : TextLineData::TextLine; + row.line[LeftSide].text = left; + row.line[LeftSide].textLineType = left.isEmpty() ? TextLineData::Separator : TextLineData::TextLine; + row.line[RightSide].text = right; + row.line[RightSide].textLineType = right.isEmpty() ? TextLineData::Separator : TextLineData::TextLine; chunk->rows.append(row); }; ChunkData chunk; @@ -1664,8 +1664,8 @@ void DiffEditor::Internal::DiffEditorPlugin::testFilterPatch() const ChunkData result = DiffEditorDocument::filterChunk(chunk, selection, revert); QCOMPARE(result.rows.size(), rows.size()); for (int i = 0; i < rows.size(); ++i) { - QCOMPARE(result.rows.at(i).leftLine.text, rows.at(i).first); - QCOMPARE(result.rows.at(i).rightLine.text, rows.at(i).second); + QCOMPARE(result.rows.at(i).line[LeftSide].text, rows.at(i).first); + QCOMPARE(result.rows.at(i).line[RightSide].text, rows.at(i).second); } } |