[Uml-devel] kdesdk/umbrello/umbrello

Sebastian Stein seb.kde at hpfsc.de
Wed Sep 10 04:59:22 UTC 2003


CVS commit by sstein: 

fix bug 57876: If no stereotype is given, the << >> won't be shown. At the moment it is not possible to set the stereotype show setting for multiple selected items. This request was somehow lost in the bug database, but I still remember and it is listed as feature for 3.2, so hopefully I find the time to implement this...


  M +7 -2      classwidget.cpp   1.9


--- kdesdk/umbrello/umbrello/classwidget.cpp  #1.8:1.9
@@ -116,5 +116,6 @@ void ClassWidget::draw(QPainter & p, int
                 p.setFont( font );
         } else {
-                if (m_bShowStereotype) {
+                /* if no stereotype is given, we don't want to show the empty << >> */
+                if (m_bShowStereotype && m_pObject->getStereotype().isEmpty() == false ) {
                         QFont f( UMLWidget::getFont() );
                         f.setBold( true );
@@ -286,6 +287,10 @@ void ClassWidget::calculateSize() {
                         ? FT_BOLD_ITALIC
                         : FT_BOLD).boundingRect(getName()).width();
-        int w = getFontMetrics(FT_BOLD).boundingRect("<< " + m_pObject -> getStereotype() + " >>").width();
 
+        /* if no stereotype is given, this line has a width of 0 */
+        int w = 0;
+        if (m_pObject->getStereotype().isEmpty() == false ) {
+                w = getFontMetrics(FT_BOLD).boundingRect("<< " + m_pObject -> getStereotype() + " >>").width();
+        }
 
         width = w > width?w:width;






More information about the umbrello-devel mailing list