summaryrefslogtreecommitdiff
path: root/noncore/styles/theme/ogfxeffect.cpp
authorsandman <sandman>2002-11-28 00:37:59 (UTC)
committer sandman <sandman>2002-11-28 00:37:59 (UTC)
commit0d508bf39ad43aa06c9cd395dd382d8e00dfbf3a (patch) (side-by-side diff)
treef4a225c3236b2608c1127e62750c4106e35bfd66 /noncore/styles/theme/ogfxeffect.cpp
parent57ad30fb514428e068142e31ee40aa1615291123 (diff)
downloadopie-0d508bf39ad43aa06c9cd395dd382d8e00dfbf3a.zip
opie-0d508bf39ad43aa06c9cd395dd382d8e00dfbf3a.tar.gz
opie-0d508bf39ad43aa06c9cd395dd382d8e00dfbf3a.tar.bz2
Some checks for null pixmaps (qtmail seems to create a scrollbar with
width and height == -1 when you tap "New mailbox")
Diffstat (limited to 'noncore/styles/theme/ogfxeffect.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/theme/ogfxeffect.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/noncore/styles/theme/ogfxeffect.cpp b/noncore/styles/theme/ogfxeffect.cpp
index 2071a67..90b45fe 100644
--- a/noncore/styles/theme/ogfxeffect.cpp
+++ b/noncore/styles/theme/ogfxeffect.cpp
@@ -27,9 +27,10 @@
QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca,
const QColor &cb, GradientType eff, int ncols)
{
- QImage image = gradient(pixmap.size(), ca, cb, eff, ncols);
- pixmap.convertFromImage(image);
-
+ if ( !pixmap. isNull ( )) {
+ QImage image = gradient(pixmap.size(), ca, cb, eff, ncols);
+ pixmap.convertFromImage(image);
+ }
return pixmap;
}
@@ -280,15 +281,16 @@ QPixmap& OGfxEffect::blend(QPixmap &pixmap, float initial_intensity,
const QColor &bgnd, GradientType eff,
bool anti_dir, int /*ncols*/)
{
- QImage image = pixmap.convertToImage();
- OGfxEffect::blend(image, initial_intensity, bgnd, eff, anti_dir);
-
- if ( pixmap. depth ( ) <= 8 )
- image. convertDepth ( pixmap. depth ( ));
+ if ( !pixmap. isNull ( )) {
+ QImage image = pixmap.convertToImage();
+ OGfxEffect::blend(image, initial_intensity, bgnd, eff, anti_dir);
- pixmap.convertFromImage(image);
+ if ( pixmap. depth ( ) <= 8 )
+ image. convertDepth ( pixmap. depth ( ));
- return pixmap;
+ pixmap.convertFromImage(image);
+ }
+ return pixmap;
}