Commit 7c5598fe authored by Laurent Montel's avatar Laurent Montel 😁

Fix infinity loop when we right click on an url in a table

parent 5c3db902
......@@ -91,7 +91,14 @@ void RichTextComposerControler::RichTextComposerControlerPrivate::selectLinkText
if (cursor->atEnd()) {
break;
}
cursor->setPosition(cursor->position() + 1, QTextCursor::KeepAnchor);
const int oldPosition = cursor->position();
cursor->movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
//Wordaround Qt Bug. when we have a table.
//FIXME selection url
if (oldPosition == cursor->position()) {
break;
}
}
if (cursor->charFormat().anchorHref() != aHref) {
cursor->setPosition(cursor->position() - 1, QTextCursor::KeepAnchor);
......@@ -99,7 +106,6 @@ void RichTextComposerControler::RichTextComposerControlerPrivate::selectLinkText
} else if (cursor->hasSelection()) {
// Nothing to to. Using the currently selected text as the link text.
} else {
// Select current word
cursor->movePosition(QTextCursor::StartOfWord);
cursor->movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment