From ac5556a78ddabd86c49435e9d5eb5b327578dd04 Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Mon, 21 May 2001 23:02:38 +0000 Subject: [PATCH] Don't crash on divisions by zero. svn path=/trunk/kdebase/kwin/; revision=98171 --- clients/kwmtheme/kwmthemeclient.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/clients/kwmtheme/kwmthemeclient.cpp b/clients/kwmtheme/kwmthemeclient.cpp index a17d5c3bcd..aa2428fd9a 100644 --- a/clients/kwmtheme/kwmthemeclient.cpp +++ b/clients/kwmtheme/kwmthemeclient.cpp @@ -431,6 +431,7 @@ void KWMThemeClient::paintEvent( QPaintEvent *) //top pm = *framePixmaps[FrameTop]; + if (pm.width() > 0){ s = width()-w2-w1; n = s/pm.width(); w = n>0?s/n:s; @@ -452,10 +453,12 @@ void KWMThemeClient::paintEvent( QPaintEvent *) break; } } + } //bottom pm = *framePixmaps[FrameBottom]; + if (pm.width() > 0){ s = width()-w4-w3; n = s/pm.width(); w = n>0?s/n:s; @@ -475,10 +478,12 @@ void KWMThemeClient::paintEvent( QPaintEvent *) break; } } + } //left pm = *framePixmaps[FrameLeft]; + if (pm.height() > 0){ s = height()-h3-h1; n = s/pm.height(); w = n>0?s/n:s; @@ -501,10 +506,12 @@ void KWMThemeClient::paintEvent( QPaintEvent *) break; } } + } //right pm = *framePixmaps[FrameRight]; + if (pm.height() > 0){ s = height()-h4-h2; n = s/pm.height(); w = n>0?s/n:s; @@ -527,6 +534,7 @@ void KWMThemeClient::paintEvent( QPaintEvent *) break; } } + } drawTitle(p); // KWM evidently had a 1 pixel border around the client window. We // emulate it here, but should be removed at some point in order to