summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/simplewidgets.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/simplewidgets.cpp')
-rw-r--r--desktop-widgets/simplewidgets.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp
index 049ce6549..5680ad867 100644
--- a/desktop-widgets/simplewidgets.cpp
+++ b/desktop-widgets/simplewidgets.cpp
@@ -748,6 +748,7 @@ QString TextHyperlinkEventFilter::fromCursorTilWhitespace(QTextCursor *cursor, c
QString grownText;
QString noSpaces;
bool movedOk = false;
+ int oldSize = -1;
do {
result = grownText; // this is a no-op on the first visit.
@@ -759,6 +760,8 @@ QString TextHyperlinkEventFilter::fromCursorTilWhitespace(QTextCursor *cursor, c
}
grownText = cursor->selectedText();
+ if (grownText.size() == oldSize) movedOk = false;
+ oldSize = grownText.size();
noSpaces = grownText.simplified().replace(" ", "");
} while (grownText == noSpaces && movedOk);