[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Wed Mar 23 14:10:19 UTC 2005


CVS commit by okellogg: 

LinkWidget::getOperationText(): Fix crash on loading sequence messages.


  M +4 -3      linkwidget.cpp   1.12
  M +2 -1      linkwidget.h   1.14
  M +2 -2      messagewidget.cpp   1.66


--- kdesdk/umbrello/umbrello/linkwidget.cpp  #1.11:1.12
@@ -41,10 +41,11 @@ void LinkWidget::setOperation(UMLOperati
 }
 
-QString LinkWidget::getOperationText() {
+QString LinkWidget::getOperationText(UMLView *view /* = NULL */) {
         if (m_pOperation == NULL)
                 return getCustomOpText();
-        UMLView *view = UMLApp::app()->getCurrentView();
+        if (view == NULL)
+                view = UMLApp::app()->getCurrentView();
         Uml::Signature_Type sigType;
-        if (view->getShowOpSig())
+        if (view && view->getShowOpSig())
                 sigType = Uml::st_SigNoScope;
         else

--- kdesdk/umbrello/umbrello/linkwidget.h  #1.13:1.14
@@ -24,4 +24,5 @@ class UMLClassifier;
 class UMLOperation;
 class FloatingText;
+class UMLView;
 
 /**
@@ -78,5 +79,5 @@ public:
          * Uses m_pOperation if set, else calls getCustomOpText().
          */
-        QString getOperationText();
+        QString getOperationText(UMLView *view = NULL);
 
         /**

--- kdesdk/umbrello/umbrello/messagewidget.cpp  #1.65:1.66
@@ -436,5 +436,5 @@ bool MessageWidget::activate(IDChangeLog
 
 void MessageWidget::setMessageText(FloatingText *ft) {
-        QString displayText = m_SequenceNumber + ": " + getOperationText();
+        QString displayText = m_SequenceNumber + ": " + getOperationText(m_pView);
         ft->setText(displayText);
         setTextPosition();
@@ -882,5 +882,5 @@ bool MessageWidget::loadFromXMI(QDomElem
                 QString tag = element.tagName();
                 if (tag == "floatingtext") {
-                        m_pFText = new FloatingText( m_pView, tr, getOperationText(), textId );
+                        m_pFText = new FloatingText( m_pView, tr, getOperationText(m_pView), textId );
                         if( ! m_pFText->loadFromXMI(element) ) {
                                 // Most likely cause: The FloatingText is empty.






More information about the umbrello-devel mailing list