[Uml-devel] kdesdk/umbrello/umbrello/dialogs
Oliver Kellogg
okellogg at users.sourceforge.net
Thu Dec 30 04:47:08 UTC 2004
CVS commit by okellogg:
Constructor, slotOk(): The owning classifier is the _grandparent_ of m_pAtt.
M +20 -10 parmpropdlg.cpp 1.23
--- kdesdk/umbrello/umbrello/dialogs/parmpropdlg.cpp #1.22:1.23
@@ -126,8 +126,13 @@ ParmPropDlg::ParmPropDlg(QWidget * paren
//add template parameters
- UMLClassifier *pConcept = static_cast<UMLClassifier*>( m_pAtt->parent() );
+ UMLClassifier *pConcept = dynamic_cast<UMLClassifier*>( m_pAtt->parent()->parent() );
+ if (pConcept == NULL) {
+ kdError() << "ParmPropDlg: grandparent of " << m_pAtt->getName()
+ << " is not a UMLClassifier" << endl;
+ } else {
UMLTemplateList tmplParams( pConcept->getTemplateList() );
for (UMLTemplate *t = tmplParams.first(); t; t = tmplParams.next())
m_pTypeCB->insertItem( t->getName() );
+ }
//now add the Concepts
UMLClassifierList namesList( m_pUmldoc->getConcepts() );
@@ -180,5 +185,9 @@ void ParmPropDlg::slotOk() {
m_pAtt->setStereotype( m_pStereoTypeLE->text() );
QString typeName = m_pTypeCB->currentText();
- UMLClassifier * pConcept = static_cast<UMLClassifier*>( m_pAtt->parent() );
+ UMLClassifier * pConcept = dynamic_cast<UMLClassifier*>( m_pAtt->parent()->parent() );
+ if (pConcept == NULL) {
+ kdError() << "ParmPropDlg::slotOk: grandparent of " << m_pAtt->getName()
+ << " is not a UMLClassifier" << endl;
+ } else {
UMLTemplate *tmplParam = pConcept->findTemplate(typeName);
if (tmplParam) {
@@ -187,4 +196,5 @@ void ParmPropDlg::slotOk() {
return;
}
+ }
UMLClassifierList namesList( m_pUmldoc->getConcepts() );
UMLClassifier * obj;
More information about the umbrello-devel
mailing list