Merge remote-tracking branch 'origin/3.5'

Change-Id: I9baaf42531c10c32a2fa78d2504de213e77fdf82
This commit is contained in:
Eike Ziller
2015-08-10 11:15:29 +02:00
20 changed files with 69 additions and 101 deletions

View File

@@ -2532,7 +2532,7 @@ void TextEditorWidget::doSetTextCursor(const QTextCursor &cursor)
void TextEditorWidget::gotoLine(int line, int column, bool centerLine)
{
d->m_lastCursorChangeWasInteresting = false; // avoid adding the previous position to history
const int blockNumber = line - 1;
const int blockNumber = qMin(line, document()->blockCount()) - 1;
const QTextBlock &block = document()->findBlockByNumber(blockNumber);
if (block.isValid()) {
QTextCursor cursor(block);