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>
This commit is contained in:
Pekka Vuorela 2012-01-03 15:07:13 +02:00 committed by Qt by Nokia
parent 24e84dd21f
commit 99eb505103

View File

@ -836,7 +836,7 @@ int QTextLayout::lineCount() const
*/ */
QTextLine QTextLayout::lineAt(int i) const QTextLine QTextLayout::lineAt(int i) const
{ {
return QTextLine(i, d); return i < lineCount() ? QTextLine(i, d) : QTextLine();
} }
/*! /*!