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:
parent
24e84dd21f
commit
99eb505103
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
Reference in New Issue
Block a user