summaryrefslogtreecommitdiffstats
path: root/kstyles/asteroid/asteroid.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-11-08 13:39:51 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-11-08 13:39:51 -0600
commit03733ab120b5c50be66c7d03fc3926d7815a8cfb (patch)
treed59b7d50a248fefacbbcc80ea470a5fa681f5bc0 /kstyles/asteroid/asteroid.cpp
parent9f835b0b506b54e14e2e45301f2d3fc84dc51432 (diff)
downloadtdelibs-03733ab120b5c50be66c7d03fc3926d7815a8cfb.tar.gz
tdelibs-03733ab120b5c50be66c7d03fc3926d7815a8cfb.zip
Fix crashes in some styles when used with third party toolkits
Diffstat (limited to 'kstyles/asteroid/asteroid.cpp')
-rw-r--r--kstyles/asteroid/asteroid.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/kstyles/asteroid/asteroid.cpp b/kstyles/asteroid/asteroid.cpp
index a5e8f88cd..a14574bb0 100644
--- a/kstyles/asteroid/asteroid.cpp
+++ b/kstyles/asteroid/asteroid.cpp
@@ -2113,7 +2113,12 @@ void AsteroidStyle::drawComplexControl(TQ_ComplexControl cc,
}
p2.end();
- bitBlt((TQWidget*)w, r.x(), r.y(), &pix);
+ if (w) {
+ bitBlt((TQWidget*)w, r.x(), r.y(), &pix);
+ }
+ else {
+ p->drawPixmap(r.topLeft(), pix);
+ }
break;
}
@@ -2429,10 +2434,6 @@ TQRect AsteroidStyle::querySubControlMetrics(TQ_ComplexControl cc,
SC_ListViewExpand
*/
case CC_ComboBox: {
- if (!w) {
- return TQRect();
- }
-
TQRect r(ceData.rect);
switch (sc) {
@@ -2552,12 +2553,11 @@ TQSize AsteroidStyle::sizeFromContents(ContentsType ct,
}
case CT_PopupMenuItem: {
- if (!w || o.isDefault()) {
+ if (o.isDefault()) {
return TQSize(0, 0);
}
int sw = s.width(), sh = s.height();
- const TQPopupMenu *popup = dynamic_cast<const TQPopupMenu *>(w);
TQMenuItem *mi = o.menuItem();
if (mi->custom()) {
@@ -2588,7 +2588,7 @@ TQSize AsteroidStyle::sizeFromContents(ContentsType ct,
int miw = o.maxIconWidth();
if (miw) {
sw += miw;
- if (popup->isCheckable()) {
+ if (elementFlags & CEF_IsCheckable) {
sw += 20 - miw;
}
}