Get rid of QChar::LineSeparator

It was causing troubles while scrolling. Replace it with
\n and hack selection. Simplify the code. Now every line
is a separate block. Prepare for expanding skipped lines.

Change-Id: I8d305681c575abdaaf9cdbf26de864dd3a906d3a
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
jkobus
2013-04-09 10:26:31 +02:00
committed by hjk
parent 7051f49a6e
commit 77abd02787
4 changed files with 140 additions and 174 deletions

View File

@@ -81,11 +81,9 @@ struct RowData {
};
struct ChunkData {
ChunkData() : skippedLinesBefore(0), leftOffset(0), rightOffset(0) {}
ChunkData() : alwaysShown(true) {}
QList<RowData> rows;
int skippedLinesBefore; // info for text
int leftOffset;
int rightOffset;
bool alwaysShown;
// <absolute position in the file, absolute position in the file>
QMap<int, int> changedLeftPositions; // counting from the beginning of the chunk
QMap<int, int> changedRightPositions; // counting from the beginning of the chunk
@@ -96,7 +94,6 @@ struct FileData {
FileData() {}
FileData(const ChunkData &chunkData) { chunks.append(chunkData); }
QList<ChunkData> chunks;
QList<int> chunkOffset;
QString text;
};
@@ -150,8 +147,6 @@ private:
ChunkData m_originalChunkData;
FileData m_contextFileData;
int m_leftSafePosHack;
int m_rightSafePosHack;
};
} // namespace DiffEditor