summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qstatictext.cpp
diff options
context:
space:
mode:
authorA-Team <ateam@pad.test.qt.nokia.com>2010-11-10 23:00:13 (GMT)
committerA-Team <ateam@pad.test.qt.nokia.com>2010-11-10 23:00:13 (GMT)
commitfce752ba402535a62e420a83483d0f92623d684a (patch)
tree24b1456a4136515524642138854d6232fb6ef634 /src/gui/text/qstatictext.cpp
parentd7da33a914a7e84ebf38cbb3244aac936838ecb1 (diff)
parent38e1ed3b51d6aad46912eb548490d038e58203d9 (diff)
downloadQt-fce752ba402535a62e420a83483d0f92623d684a.zip
Qt-fce752ba402535a62e420a83483d0f92623d684a.tar.gz
Qt-fce752ba402535a62e420a83483d0f92623d684a.tar.bz2
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src/gui/text/qstatictext.cpp')
-rw-r--r--src/gui/text/qstatictext.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 9506006..edf248a 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -445,7 +445,7 @@ namespace {
const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
QStaticTextItem currentItem;
- currentItem.fontEngine = ti.fontEngine;
+ currentItem.setFontEngine(ti.fontEngine);
currentItem.font = ti.font();
currentItem.charOffset = m_chars.size();
currentItem.numChars = ti.num_chars;
@@ -713,4 +713,24 @@ void QStaticTextPrivate::init()
needsRelayout = false;
}
+QStaticTextItem::~QStaticTextItem()
+{
+ if (m_userData != 0 && !m_userData->ref.deref())
+ delete m_userData;
+ if (!m_fontEngine->ref.deref())
+ delete m_fontEngine;
+}
+
+void QStaticTextItem::setFontEngine(QFontEngine *fe)
+{
+ if (m_fontEngine != 0) {
+ if (!m_fontEngine->ref.deref())
+ delete m_fontEngine;
+ }
+
+ m_fontEngine = fe;
+ if (m_fontEngine != 0)
+ m_fontEngine->ref.ref();
+}
+
QT_END_NAMESPACE