summaryrefslogtreecommitdiffstats
path: root/src/qt3support/text/q3richtext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt3support/text/q3richtext.cpp')
-rw-r--r--src/qt3support/text/q3richtext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qt3support/text/q3richtext.cpp b/src/qt3support/text/q3richtext.cpp
index c058e37..e508001 100644
--- a/src/qt3support/text/q3richtext.cpp
+++ b/src/qt3support/text/q3richtext.cpp
@@ -4895,7 +4895,8 @@ void Q3TextParagraph::drawString(QPainter &painter, const QString &str, int star
bool extendRight = false;
bool extendLeft = false;
bool selWrap = (real_selEnd == length()-1 && n && n->hasSelection(it.key()));
- if (selWrap || this->str->at(real_selEnd).lineStart) {
+ if (selWrap
+ || ((real_selEnd < this->str->length()) && this->str->at(real_selEnd).lineStart)) {
extendRight = (fullSelectionWidth != 0);
if (!extendRight && !rightToLeft)
tmpw += painter.fontMetrics().width(QLatin1Char(' '));