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:
Marco Bubke
2017-11-23 14:30:09 +01:00
parent 7666db896d
commit e0ea602f6c
4 changed files with 36 additions and 11 deletions

View File

@@ -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)