diff options
author | Pekka Vuorela <pekka.ta.vuorela@nokia.com> | 2012-01-03 15:07:13 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-05 02:17:04 +0100 |
commit | 99eb5051039052bc782ca3224aac1c9b99c67b28 (patch) | |
tree | d116ffe41824d51a865096ea637adb9375e59ca7 /src/gui | |
parent | 24e84dd21f649a270e03a83a6e7688e1649a7ede (diff) |
QTextLayout::lineAt() to return invalid line if index is out of bounds
Change-Id: I1f93789c96f3b2335b02897ff5fc8385964d1641
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 6cf24d130b..d470c6daac 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -836,7 +836,7 @@ int QTextLayout::lineCount() const */ QTextLine QTextLayout::lineAt(int i) const { - return QTextLine(i, d); + return i < lineCount() ? QTextLine(i, d) : QTextLine(); } /*! |