summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-write/qrichtext.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-write/qrichtext.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-write/qrichtext.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/noncore/apps/opie-write/qrichtext.cpp b/noncore/apps/opie-write/qrichtext.cpp
index c27eb1e..f040f1e 100644
--- a/noncore/apps/opie-write/qrichtext.cpp
+++ b/noncore/apps/opie-write/qrichtext.cpp
@@ -6057,21 +6057,20 @@ struct QPixmapInt
6057}; 6057};
6058 6058
6059static QMap<QString, QPixmapInt> *pixmap_map = 0; 6059static QMap<QString, QPixmapInt> *pixmap_map = 0;
6060 6060
6061QTextImage::QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, 6061QTextImage::QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context,
6062 QMimeSourceFactory &factory ) 6062 QMimeSourceFactory &factory )
6063 : QTextCustomItem( p ) 6063 : QTextCustomItem( p ), reg( 0 )
6064{ 6064{
6065 width = height = 0; 6065 width = height = 0;
6066 if ( attr.contains("width") ) 6066 if ( attr.contains("width") )
6067 width = attr["width"].toInt(); 6067 width = attr["width"].toInt();
6068 if ( attr.contains("height") ) 6068 if ( attr.contains("height") )
6069 height = attr["height"].toInt(); 6069 height = attr["height"].toInt();
6070 6070
6071 reg = 0;
6072 QString imageName = attr["src"]; 6071 QString imageName = attr["src"];
6073 6072
6074 if (!imageName) 6073 if (!imageName)
6075 imageName = attr["source"]; 6074 imageName = attr["source"];
6076 6075
6077 if ( !imageName.isEmpty() ) { 6076 if ( !imageName.isEmpty() ) {
@@ -6146,24 +6145,24 @@ QTextImage::QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, co
6146 6145
6147 attributes = attr; 6146 attributes = attr;
6148} 6147}
6149 6148
6150QTextImage::~QTextImage() 6149QTextImage::~QTextImage()
6151{ 6150{
6151 delete reg;
6152 if ( pixmap_map && pixmap_map->contains( imgId ) ) { 6152 if ( pixmap_map && pixmap_map->contains( imgId ) ) {
6153 QPixmapInt& pmi = pixmap_map->operator[](imgId); 6153 QPixmapInt& pmi = pixmap_map->operator[](imgId);
6154 pmi.ref--; 6154 pmi.ref--;
6155 if ( !pmi.ref ) { 6155 if ( !pmi.ref ) {
6156 pixmap_map->remove( imgId ); 6156 pixmap_map->remove( imgId );
6157 if ( pixmap_map->isEmpty() ) { 6157 if ( pixmap_map->isEmpty() ) {
6158 delete pixmap_map; 6158 delete pixmap_map;
6159 pixmap_map = 0; 6159 pixmap_map = 0;
6160 } 6160 }
6161 } 6161 }
6162 } 6162 }
6163 delete reg;
6164} 6163}
6165 6164
6166QString QTextImage::richText() const 6165QString QTextImage::richText() const
6167{ 6166{
6168 QString s; 6167 QString s;
6169 s += "<img "; 6168 s += "<img ";