Summary: | No synchronisation of comments for Java/UML templates when round-tripping | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Ian Stokes-Rees <Ian.Stokes-Rees> |
Component: | general | Assignee: | Oliver Kellogg <okellogg> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Ian Stokes-Rees
2007-04-17 16:35:21 UTC
> [...] Not nice.
You have a point there :)
SVN commit 655249 by okellogg: showDocumentation(UMLObject*, bool): Calling updateDocumentation() ruins the object->m_Doc. CCBUG:144346 M +1 -2 docwindow.cpp --- branches/KDE/3.5/kdesdk/umbrello/umbrello/docwindow.cpp #655248:655249 @@ -50,8 +50,7 @@ void DocWindow::showDocumentation( UMLObject * object, bool overwrite ) { if( object == m_pUMLObject && !overwrite ) return; - if( object != m_pUMLObject ) - updateDocumentation( true ); + m_Showing = st_UMLObject; if( !object ) { m_pDocMLE->setText( m_pUMLDoc->getDocumentation() ); SVN commit 655250 by okellogg: insertMethod(): Call UMLClassifier::checkOperationSignature() on the new op. If it exists then copy the properties of the new op to the existing op. All code: Do not call DocWindow::showDocumentation(), it spoils the UMLObject::m_Doc. BUG:144346 M +1 -0 ChangeLog M +29 -6 umbrello/codeimport/import_utils.cpp --- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #655249:655250 @@ -30,6 +30,7 @@ * Crash on changing multiplicity in an association in ERD (143909) * Class diagram in folder not loaded correctly from xmi (144119) * Sequence diagram crashes during message inserting (144293) +* No synchronisation of comments when round-tripping (144346) Version 1.5.61 --- branches/KDE/3.5/kdesdk/umbrello/umbrello/codeimport/import_utils.cpp #655249:655250 @@ -244,7 +244,7 @@ QString strippedComment = formatComment(comment); if (! strippedComment.isEmpty()) { o->setDoc(strippedComment); - UMLApp::app()->getDocWindow()->showDocumentation(o, true); + //UMLApp::app()->getDocWindow()->showDocumentation(o, true); } if (!stereotype.isEmpty()) { o->setStereotype(stereotype); @@ -304,7 +304,7 @@ QString strippedComment = formatComment(comment); if (! strippedComment.isEmpty()) { attr->setDoc(strippedComment); - UMLApp::app()->getDocWindow()->showDocumentation(attr, true); + //UMLApp::app()->getDocWindow()->showDocumentation(attr, true); } UMLApp::app()->getDocument()->setModified(true); @@ -362,14 +362,37 @@ if (isConstructor) op->setStereotype("constructor"); - klass->addOperation(op); - //umldoc->signalUMLObjectCreated(op); QString strippedComment = formatComment(comment); if (! strippedComment.isEmpty()) { op->setDoc(strippedComment); - UMLApp::app()->getDocWindow()->showDocumentation(op, true); } - //setModified(true); + + UMLAttributeList params = op->getParmList(); + UMLOperation *exist = klass->checkOperationSignature(op->getName(), params); + if (exist) { + // copy contents to existing operation + exist->setVisibility(scope); + exist->setStatic(isStatic); + exist->setAbstract(isAbstract); + if (! strippedComment.isEmpty()) + exist->setDoc(strippedComment); + UMLAttributeList exParams = exist->getParmList(); + UMLAttribute *param, *exParam = exParams.first(); + for (UMLAttributeListIt it(params); (param = it.current()) != NULL; + ++it, exParam = exParams.next()) { + exParam->setName(param->getName()); + exParam->setVisibility(param->getVisibility()); + exParam->setStatic(param->getStatic()); + exParam->setAbstract(param->getAbstract()); + exParam->setDoc(param->getDoc()); + exParam->setInitialValue(param->getInitialValue()); + exParam->setParmKind(param->getParmKind()); + } + // delete temporary UMLOperation + delete op; + } else { + klass->addOperation(op); + } } UMLAttribute* addMethodParameter(UMLOperation *method, SVN commit 655558 by okellogg: showDocumentation(UMLObject*, bool): Revert r655249. The real fix was to remove the calls to showDocumentation() from Import_Utils. CCBUG:144346 M +2 -0 docwindow.cpp --- branches/KDE/3.5/kdesdk/umbrello/umbrello/docwindow.cpp #655557:655558 @@ -50,6 +50,8 @@ void DocWindow::showDocumentation( UMLObject * object, bool overwrite ) { if( object == m_pUMLObject && !overwrite ) return; + if( object != m_pUMLObject ) + updateDocumentation( true ); m_Showing = st_UMLObject; if( !object ) { |