From d0a71f37ed136c0e93fcb2adfa9907aa03e4d6a1 Mon Sep 17 00:00:00 2001 From: fourtf Date: Tue, 10 Apr 2018 15:52:47 +0200 Subject: [PATCH] fixed text copying if a single word is selected --- src/messages/layouts/messagelayoutcontainer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/messages/layouts/messagelayoutcontainer.cpp b/src/messages/layouts/messagelayoutcontainer.cpp index 596842d8..b9e78186 100644 --- a/src/messages/layouts/messagelayoutcontainer.cpp +++ b/src/messages/layouts/messagelayoutcontainer.cpp @@ -419,8 +419,12 @@ void MessageLayoutContainer::addSelectionText(QString &str, int from, int to) if (first) { if (index + c > from) { - ele->addCopyTextToString(str, from - index, to - from); + ele->addCopyTextToString(str, from - index, to - index); first = false; + + if (index + c > to) { + break; + } } } else { if (index + c > to) {