[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg Oliver.Kellogg at t-online.de
Sat Sep 13 10:46:04 UTC 2003


CVS commit by okellogg: 

calculateSize(): Strengthen defense.


  M +4 -3      nodewidget.cpp   1.9


--- kdesdk/umbrello/umbrello/nodewidget.cpp  #1.8:1.9
@@ -109,5 +109,6 @@ void NodeWidget::draw(QPainter & p, int 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 void NodeWidget::calculateSize() {
-        int width, height;
+        if (m_pObject == NULL)
+                return;
 
         QFontMetrics &fm = getFontMetrics(FT_BOLD_ITALIC);
@@ -119,5 +120,5 @@ void NodeWidget::calculateSize() {
         }
 
-        width = fm.width(name);
+        int width = fm.width(name);
 
         int tempWidth = 0;
@@ -128,5 +129,5 @@ void NodeWidget::calculateSize() {
         width += NODE_MARGIN * 2;
 
-        height = (2*fontHeight) + (NODE_MARGIN * 2);
+        int height = (2*fontHeight) + (NODE_MARGIN * 2);
 
         width = static_cast<int>(width * 1.5);






More information about the umbrello-devel mailing list