[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
Oliver.Kellogg at t-online.de
Sat Sep 13 15:23:08 UTC 2003
CVS commit by okellogg:
draw(): Guard against m_pObject being NULL.
M +8 -11 packagewidget.cpp 1.7
--- kdesdk/umbrello/umbrello/packagewidget.cpp #1.6:1.7
@@ -58,5 +58,4 @@ void PackageWidget::draw(QPainter & p, i
int fontHeight = fm.lineSpacing();
QString name = getName();
- QString stereotype = m_pObject->getStereotype();
p.drawRect(offsetX, offsetY, 50, fontHeight);
@@ -66,14 +65,12 @@ void PackageWidget::draw(QPainter & p, i
p.setFont(font);
+ int lines = 1;
+ if (m_pObject != NULL) {
+ QString stereotype = m_pObject->getStereotype();
if (stereotype != "") {
p.drawText(offsetX, offsetY + fontHeight + PACKAGE_MARGIN,
w, fontHeight, AlignCenter, "<< " + stereotype + " >>");
- }
-
- int lines;
- if (stereotype != "") {
lines = 2;
- } else {
- lines = 1;
+ }
}
More information about the umbrello-devel
mailing list