summaryrefslogtreecommitdiffstats
path: root/src/qt3support
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-04-02 11:27:57 +0200
committerGunnar Sletta <gunnar@trolltech.com>2009-04-07 08:30:04 +0200
commite0560bcaa3703fafccc21dd709731341a123a0e4 (patch)
tree5e124735a8edf8e09290f0b6855e7f11726d7fba /src/qt3support
parentb78d46626aa3fd34009063fc0d870cf528119af5 (diff)
Works around a crash in q3richtext.
Full fix will potentially break other code and is thus avoided Task-number: 248992 Reviewed-by: Trond
Diffstat (limited to 'src/qt3support')
-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 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(' '));