summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2011-02-23 13:46:34 (GMT)
committermae <qt-info@nokia.com>2011-02-23 13:54:52 (GMT)
commita2c10e7f58b1031a94c7a31ccf34cfd34e65f515 (patch)
treea02e7b1e5cd30e411e1dfeabcce1caa008a61da7 /src/gui
parentd9d68c383b7b1438d3034cd3708cfba5fb9706ef (diff)
downloadQt-a2c10e7f58b1031a94c7a31ccf34cfd34e65f515.zip
Qt-a2c10e7f58b1031a94c7a31ccf34cfd34e65f515.tar.gz
Qt-a2c10e7f58b1031a94c7a31ccf34cfd34e65f515.tar.bz2
Fix QPlainTextEdit corruption/crash with scrolling
There was an off-by-one error when QPlainTextEdit calculated the number of visible lines (not blocks) on the screne. When running into the error case, the number of visible lines was falsely 0 (not 1), which resulted in all softs of negative side effects as the scrollbar permitted the user to scroll behind the last paragraph. Task-number: QTBUG-17230 Reviewed-by: con
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/qplaintextedit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index d3af9e1..7435691 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -967,7 +967,7 @@ void QPlainTextEditPrivate::_q_adjustScrollbars()
++lineNumber;
}
if (lineNumber < layoutLineCount)
- visibleFromBottom += (layoutLineCount - lineNumber - 1);
+ visibleFromBottom += (layoutLineCount - lineNumber);
break;
}