Fix crash when computing the selection path.

Task-number: QTCREATORBUG-3097
Reviewed-by: con
This commit is contained in:
Christian Kamm
2010-11-15 15:32:46 +01:00
committed by con
parent a783a90f4d
commit 3564feacce

View File

@@ -166,10 +166,12 @@ QPainterPath TextEditorOverlay::createSelectionPath(const QTextCursor &begin, co
int beginChar = 0;
if (!inSelection) {
beginChar = begin.positionInBlock();
line = blockLayout->lineForTextPosition(beginChar);
if (block == begin.block()) {
beginChar = begin.positionInBlock();
line = blockLayout->lineForTextPosition(beginChar);
firstOrLastBlock = true;
}
inSelection = true;
firstOrLastBlock = true;
} else {
// while (beginChar < block.length() && document->characterAt(block.position() + beginChar).isSpace())
// ++beginChar;