mirror of
https://gitlab.com/smart-pattern/valentina.git
synced 2024-09-18 23:04:03 +02:00
Add check to prevent warning: QTextCursor::setPosition: Position '%d' out of range.
This commit is contained in:
parent
dc7f0fc74f
commit
ded74a25e3
|
@ -205,6 +205,12 @@ auto VPlainTextEdit::MatchRightParenthesis(QTextBlock currentBlock, int i, int n
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPlainTextEdit::CreateParenthesisSelection(int pos, bool match)
|
||||
{
|
||||
if (pos < 0 || pos >= toPlainText().length())
|
||||
{
|
||||
qDebug() << "String:" << toPlainText() << "Position '" << pos << "' out of range";
|
||||
return;
|
||||
}
|
||||
|
||||
QList<QTextEdit::ExtraSelection> selections = extraSelections();
|
||||
|
||||
QTextEdit::ExtraSelection selection;
|
||||
|
|
Loading…
Reference in a new issue