summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>2012-01-03 15:07:13 +0200
committerQt by Nokia <qt-info@nokia.com>2012-01-05 02:17:04 +0100
commit99eb5051039052bc782ca3224aac1c9b99c67b28 (patch)
treed116ffe41824d51a865096ea637adb9375e59ca7 /src/gui/text
parent24e84dd21f649a270e03a83a6e7688e1649a7ede (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/text')
-rw-r--r--src/gui/text/qtextlayout.cpp2
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();
}
/*!