From 99eb5051039052bc782ca3224aac1c9b99c67b28 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Tue, 3 Jan 2012 15:07:13 +0200 Subject: QTextLayout::lineAt() to return invalid line if index is out of bounds Change-Id: I1f93789c96f3b2335b02897ff5fc8385964d1641 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextlayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') 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(); } /*! -- cgit v1.2.3