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
@@ -41,5 +41,5 @@
#include <stdlib.h>
-extern QRect qt_maxWindowRect;
+extern QRect qt_maxWindowRect;
#define WHATSTHIS_MODE
@@ -108,5 +108,6 @@ public:
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 );
} else {
@@ -648,5 +649,5 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
br.width()-2*grab, b );
}
- break;
+ break;
case Left:
if ( !widget->isMaximized() ) {
@@ -657,5 +658,5 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
b, br.height()-2*grab );
}
- break;
+ break;
case Right:
if ( !widget->isMaximized() ) {
@@ -666,5 +667,5 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
b, br.height()-2*grab );
}
- break;
+ break;
case Bottom:
if ( !widget->isMaximized() ) {
@@ -686,5 +687,5 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
region = m & crgn;
}
- break;
+ break;
case TopRight:
if ( !widget->isMaximized() ) {
@@ -704,5 +705,5 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
region = m & QRect( br.left(), br.bottom()-grab, grab, grab );
}
- break;
+ break;
case BottomRight:
if ( !widget->isMaximized() ) {
@@ -823,9 +824,9 @@ void QPEDecoration::paintButton(QPainter *painter, const QWidget *w,
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
{
QWSDecoration::maximize( widget );
@@ -854,5 +855,5 @@ void QPEDecoration::minimize( QWidget *widget )
HackDialog *d = (HackDialog *)widget;
d->acceptIt();
- }
+ }
#endif
else if ( ((HackWidget *)widget)->needsOk() ) {