forked from qt-creator/qt-creator
Clang: Use LineColumn instead of explicit integers for line and column
With OptionalLineColumn we don't need any bool return parameter any more. Change-Id: I6f57f221c1bfdf08a92a87a7d71ea0eecf83dbcf Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -46,6 +46,18 @@ bool convertPosition(const QTextDocument *document, int pos, int *line, int *col
|
||||
}
|
||||
}
|
||||
|
||||
Utils::OptionalLineColumn convertPosition(const QTextDocument *document, int pos)
|
||||
{
|
||||
Utils::OptionalLineColumn optional;
|
||||
|
||||
QTextBlock block = document->findBlock(pos);
|
||||
|
||||
if (block.isValid())
|
||||
optional.emplace(block.blockNumber() + 1, pos - block.position());
|
||||
|
||||
return optional;
|
||||
}
|
||||
|
||||
QString textAt(QTextCursor tc, int pos, int length)
|
||||
{
|
||||
if (pos < 0)
|
||||
|
||||
Reference in New Issue
Block a user