Fix critical vertical block selection issue

Vertical block selections could be painted where there was no
selection, or they could jump randomly to columns futher right.

Reviewed-by: dt
This commit is contained in:
mae
2010-05-21 16:06:31 +02:00
parent e9d1841552
commit 076c03498f
2 changed files with 4 additions and 3 deletions

View File

@@ -2466,7 +2466,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
const QAbstractTextDocumentLayout::Selection &range = context.selections.at(i);
const int selStart = range.cursor.selectionStart() - blpos;
const int selEnd = range.cursor.selectionEnd() - blpos;
if (selStart <= bllen && selEnd >= 0
if (selStart < bllen && selEnd >= 0
&& selEnd >= selStart) {
QTextLayout::FormatRange o;
o.start = selStart;