From d0f1ea8502f45e6d3e4782053c0f0f1c929dc0eb 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 596842d8a..b9e781869 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) {