forked from qt-creator/qt-creator
Utils: remove OptionalLineColumn
LineColumn already has a isValid() that is sufficient for the use case. Change-Id: I7f6e1d64b66a9af05d74ce0ef45717265dc28ed3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -53,16 +53,13 @@ bool convertPosition(const QTextDocument *document, int pos, int *line, int *col
|
||||
}
|
||||
}
|
||||
|
||||
OptionalLineColumn convertPosition(const QTextDocument *document, int pos)
|
||||
LineColumn convertPosition(const QTextDocument *document, int pos)
|
||||
{
|
||||
OptionalLineColumn optional;
|
||||
|
||||
QTextBlock block = document->findBlock(pos);
|
||||
|
||||
const QTextBlock block = document->findBlock(pos);
|
||||
if (block.isValid())
|
||||
optional.emplace(block.blockNumber() + 1, pos - block.position());
|
||||
return {block.blockNumber() + 1, pos - block.position()};
|
||||
|
||||
return optional;
|
||||
return {};
|
||||
}
|
||||
|
||||
int positionInText(const QTextDocument *textDocument, int line, int column)
|
||||
|
||||
Reference in New Issue
Block a user