summaryrefslogtreecommitdiff
authorzecke <zecke>2002-09-10 13:54:23 (UTC)
committer zecke <zecke>2002-09-10 13:54:23 (UTC)
commit4aad041a733e2478ff29330e1544e5fefcfb5cde (patch) (side-by-side diff)
treed45f21fa4570037b516ebfc1dd95aac56b3e6660
parent9ae3234e770008c4fac9dc69ffc9bb0cb0f1b2ae (diff)
downloadopie-4aad041a733e2478ff29330e1544e5fefcfb5cde.zip
opie-4aad041a733e2478ff29330e1544e5fefcfb5cde.tar.gz
opie-4aad041a733e2478ff29330e1544e5fefcfb5cde.tar.bz2
Fix floating point exception divide by 0 in qpedecoration
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpedecoration_qws.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp
index 222d906..c2eb751 100644
--- a/library/qpedecoration_qws.cpp
+++ b/library/qpedecoration_qws.cpp
@@ -42,3 +42,3 @@
-extern QRect qt_maxWindowRect;
+extern QRect qt_maxWindowRect;
@@ -109,3 +109,4 @@ static QImage scaleButton( const QImage &img, int height )
{
- if ( img.height() != height ) {
+ qWarning("Height %d %d", height, img.height() );
+ if ( img.height()!=0 && img.height() != height ) {
return img.smoothScale( img.width()*height/img.height(), height );
@@ -649,3 +650,3 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
}
- break;
+ break;
case Left:
@@ -658,3 +659,3 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
}
- break;
+ break;
case Right:
@@ -667,3 +668,3 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
}
- break;
+ break;
case Bottom:
@@ -687,3 +688,3 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
}
- break;
+ break;
case TopRight:
@@ -705,3 +706,3 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
}
- break;
+ break;
case BottomRight:
@@ -824,7 +825,7 @@ void QPEDecoration::maximize( QWidget *widget )
{
-#ifdef QPE_DONT_SHOW_TITLEBAR
+#ifdef QPE_DONT_SHOW_TITLEBAR
if ( !widget->inherits( "QDialog" ) ) {
widget->setGeometry( qt_maxWindowRect );
- } else
-#endif
+ } else
+#endif
{
@@ -855,3 +856,3 @@ void QPEDecoration::minimize( QWidget *widget )
d->acceptIt();
- }
+ }
#endif