Utils: Adjust column numbers affected by convertPosition change

convertPosition change was introduced in 931ec39f64.
It changed 0-based column to 1-based which is how it
naturally is in Qt Creator.

This fixed some usages but broke many more. This is an
attempt to fix the remaining use cases.

Fixes CppEditor auto-tests.

Change-Id: Ia8d14da0ebb035cd2fdd6da4ff6ec89c1c5121a8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-11-02 14:17:12 +01:00
parent 3d93945840
commit 8469e317c9
20 changed files with 72 additions and 60 deletions

View File

@@ -423,7 +423,7 @@ void Manager::onDocumentUpdated(CPlusPlus::Document::Ptr doc)
/*!
Opens the text editor for the file \a fileName on \a line (1-based) and
\a column (1-based).
\a column (0-based).
*/
void Manager::gotoLocation(const QString &fileName, int line, int column)
@@ -468,7 +468,8 @@ void Manager::gotoLocations(const QList<QVariant> &list)
}
}
}
gotoLocation(loc.fileName(), loc.line(), loc.column());
// line is 1-based, column is 0-based
gotoLocation(loc.fileName(), loc.line(), loc.column() - 1);
}
/*!