[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sat Jan 1 15:39:06 UTC 2005


CVS commit by okellogg: 

ClassifierWidget::drawMembers(): Remove the bodyOffsetY arg and fix
a regression in argument/operation text Y coordinate computation.


  M +2 -2      classifierwidget.cpp   1.7
  M +1 -1      classifierwidget.h   1.7
  M +6 -14     classwidget.cpp   1.38
  M +4 -7      interfacewidget.cpp   1.31


--- kdesdk/umbrello/umbrello/classifierwidget.cpp  #1.6:1.7
@@ -203,5 +203,5 @@ int ClassifierWidget::displayedOperation
 
 void ClassifierWidget::drawMembers(QPainter & p, Uml::Object_Type ot, Uml::Signature_Type sigType,
-                                   int x, int bodyOffsetY, int y, int fontHeight) {
+                                   int x, int y, int fontHeight) {
         QFont f = UMLWidget::getFont();
         f.setBold(false);
@@ -216,5 +216,5 @@ void ClassifierWidget::drawMembers(QPain
                 p.setFont( f );
                 QFontMetrics fontMetrics(f);
-                p.drawText(x, bodyOffsetY + y, fontMetrics.width(text), fontHeight, AlignVCenter, text);
+                p.drawText(x, y, fontMetrics.width(text), fontHeight, AlignVCenter, text);
                 f.setItalic(false);
                 f.setUnderline(false);

--- kdesdk/umbrello/umbrello/classifierwidget.h  #1.6:1.7
@@ -201,5 +201,5 @@ protected:
          */
         void drawMembers(QPainter & p, Uml::Object_Type ot, Uml::Signature_Type sigType,
-                         int x, int bodyOffsetY, int y, int fontHeight);
+                         int x, int y, int fontHeight);
 
         bool m_bShowOperations;            ///< Loaded/saved item.

--- kdesdk/umbrello/umbrello/classwidget.cpp  #1.37:1.38
@@ -129,9 +129,4 @@ void ClassWidget::draw(QPainter & p, int
         }
 
-        int aStart = 0;
-        if (m_bShowStereotype) {
-                aStart += fontHeight;
-        }
-
         p.setPen(QPen(black));
         UMLClass *umlclass = static_cast<UMLClass*>(m_pObject);
@@ -139,5 +134,5 @@ void ClassWidget::draw(QPainter & p, int
         if (m_bShowAttributes) {
                 drawMembers(p, Uml::ot_Attribute, m_ShowAttSigs, textX,
-                            bodyOffsetY, aStart, fontHeight);
+                            bodyOffsetY, fontHeight);
         }//end if att
 
@@ -145,16 +140,13 @@ void ClassWidget::draw(QPainter & p, int
         if (m_bShowOperations) {
                 QFont f = UMLWidget::getFont();
-                int oStart = numAtts * fontHeight + aStart;
-                if (numAtts == 0)
-                        oStart += fontHeight / 2;
-                int y = oStart;
+                int oStart = numAtts * fontHeight;
+                bodyOffsetY += oStart;
                 if (m_bShowAttributes) {
                         UMLWidget::draw(p, offsetX, offsetY);
-                        p.drawLine(offsetX, bodyOffsetY + y, offsetX + w - 1, bodyOffsetY + y);
+                        p.drawLine(offsetX, bodyOffsetY, offsetX + w - 1, bodyOffsetY);
                         p.setPen(QPen(black));
-                } else
-                        y = aStart;
+                }
                 drawMembers(p, Uml::ot_Operation, m_ShowOpSigs, textX,
-                            bodyOffsetY, y, fontHeight);
+                            bodyOffsetY, fontHeight);
         }//end if op
 

--- kdesdk/umbrello/umbrello/interfacewidget.cpp  #1.30:1.31
@@ -129,8 +129,4 @@ void InterfaceWidget::drawAsConcept(QPai
         p.setFont(font);
 
-
-        int operationsStart = fontHeight * 2;
-        int y;
-
         if ( m_bShowOperations ) {
                 QFont font = UMLWidget::getFont();
@@ -139,11 +135,12 @@ void InterfaceWidget::drawAsConcept(QPai
                 font.setBold(false);
 
-                y = operationsStart;
                 UMLWidget::draw(p, offsetX, offsetY);
 
-                p.drawLine(offsetX, offsetY + y, offsetX + w - 1, offsetY + y);
+                const int operationsStart = fontHeight * 2;
+                const int y = offsetY + operationsStart;
+                p.drawLine(offsetX, y, offsetX + w - 1, y);
                 p.setPen( QPen(black) );
                 drawMembers(p, Uml::ot_Operation, m_ShowOpSigs,
-                            offsetX + ClassifierWidget::MARGIN, offsetY, y, fontHeight);
+                            offsetX + ClassifierWidget::MARGIN, y, fontHeight);
         }//end if op
 






More information about the umbrello-devel mailing list