From e0560bcaa3703fafccc21dd709731341a123a0e4 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 2 Apr 2009 11:27:57 +0200 Subject: Works around a crash in q3richtext. Full fix will potentially break other code and is thus avoided Task-number: 248992 Reviewed-by: Trond --- src/qt3support/text/q3richtext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qt3support') diff --git a/src/qt3support/text/q3richtext.cpp b/src/qt3support/text/q3richtext.cpp index c058e378b7..e50800150f 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(' ')); -- cgit v1.2.3