summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextobject.cpp
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-03-26 12:40:18 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-03-26 12:40:52 (GMT)
commit2ba3cd8175e54a2e122591f12dacdeaa81a9af46 (patch)
treee4d714166eb2d016be65914b8d0d2c79a559ef9a /src/gui/text/qtextobject.cpp
parentb641daa11d579f58468be7f30042a100d8c483c5 (diff)
downloadQt-2ba3cd8175e54a2e122591f12dacdeaa81a9af46.zip
Qt-2ba3cd8175e54a2e122591f12dacdeaa81a9af46.tar.gz
Qt-2ba3cd8175e54a2e122591f12dacdeaa81a9af46.tar.bz2
Fix crash when accessing newly constructed QTextObjects.
The pieceTable member was only initialized by QTextDocumentPrivate _after_ the call to createObject. This patch initializes it at construction time. Task-number: 246138 Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui/text/qtextobject.cpp')
-rw-r--r--src/gui/text/qtextobject.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index 1645a21..3f4c8e5 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -88,7 +88,7 @@ QT_BEGIN_NAMESPACE
from QTextDocument::createObject().
*/
QTextObject::QTextObject(QTextDocument *doc)
- : QObject(*new QTextObjectPrivate, doc)
+ : QObject(*new QTextObjectPrivate(doc), doc)
{
}
@@ -98,7 +98,7 @@ QTextObject::QTextObject(QTextDocument *doc)
\internal
*/
QTextObject::QTextObject(QTextObjectPrivate &p, QTextDocument *doc)
- :QObject(p, doc)
+ : QObject(p, doc)
{
}
@@ -221,7 +221,7 @@ void QTextBlockGroupPrivate::markBlocksDirty()
QTextDocument::createObject().
*/
QTextBlockGroup::QTextBlockGroup(QTextDocument *doc)
- : QTextObject(*new QTextBlockGroupPrivate, doc)
+ : QTextObject(*new QTextBlockGroupPrivate(doc), doc)
{
}
@@ -410,7 +410,7 @@ QTextFrameLayoutData::~QTextFrameLayoutData()
Creates a new empty frame for the text \a document.
*/
QTextFrame::QTextFrame(QTextDocument *doc)
- : QTextObject(*new QTextFramePrivate, doc)
+ : QTextObject(*new QTextFramePrivate(doc), doc)
{
Q_D(QTextFrame);
d->fragment_start = 0;