summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-04-02 09:27:57 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-04-07 06:34:40 (GMT)
commit10eee82df6affdbb4518edebe4e845907d4ce0c3 (patch)
tree7ff43d23d88867ef074f3879e41677da3af766a9 /src
parent7255e03be8f9caa8fc9240ada2605a7b60a31e36 (diff)
downloadQt-10eee82df6affdbb4518edebe4e845907d4ce0c3.zip
Qt-10eee82df6affdbb4518edebe4e845907d4ce0c3.tar.gz
Qt-10eee82df6affdbb4518edebe4e845907d4ce0c3.tar.bz2
Works around a crash in q3richtext.
Full fix will potentially break other code and is thus avoided Task-number: 248992 Reviewed-by: Trond (cherry picked from commit e0560bcaa3703fafccc21dd709731341a123a0e4)
Diffstat (limited to 'src')
-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(' '));