summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2010-12-06 14:55:22 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2010-12-06 15:13:21 (GMT)
commitfd3fc0b34a891751e6a0849421e8cecd19481324 (patch)
treee495645e44eba93e33010c6eefb838c3f544e7ca
parent9a63863d6f0c614c041c3d4b375bf88d93148ef7 (diff)
downloadQt-fd3fc0b34a891751e6a0849421e8cecd19481324.zip
Qt-fd3fc0b34a891751e6a0849421e8cecd19481324.tar.gz
Qt-fd3fc0b34a891751e6a0849421e8cecd19481324.tar.bz2
Fix crash in QTextDocument::markContentsDirty
6f6c25b6 introduced this regression because it didn't check d->lout before calling d->lout->documentChange(). Task-number: QTBUG-15777 Reviewed-by: Eskil
-rw-r--r--src/gui/text/qtextdocument.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index c35069f..77e6aa1 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -596,8 +596,10 @@ void QTextDocument::markContentsDirty(int from, int length)
Q_D(QTextDocument);
d->documentChange(from, length);
if (!d->inContentsChange) {
- d->lout->documentChanged(d->docChangeFrom, d->docChangeOldLength, d->docChangeLength);
- d->docChangeFrom = -1;
+ if (d->lout) {
+ d->lout->documentChanged(d->docChangeFrom, d->docChangeOldLength, d->docChangeLength);
+ d->docChangeFrom = -1;
+ }
}
}