Copy and paste of a synchronous message in a sequence diagram somehow creates a somehow shared label copy. Reproducible: Always Steps to Reproduce: 1. open umbrello 2. create a sequence diagram 3. add an object 4. add a synchronous messages from the object to the object (self message) using the name 'test' 5. copy and paste this message and move it down 6. move the first message to another vertical location Actual Results: After releasing the mouse the label of the second message will be moved to the first message label. Moving the second message will restore the second label position. Expected Results: The label position of the second message should not be related to the first message movement.
Inspecting the xmi file from a save of the test case shows that the labels shares the same localid and the message widgets shares the same textid: <messagewidget localid="ZzIE2ALK1HXe" textid="Znxj2kPJx0Tp" xmi.id="GCdCuRAwmemS" > <floatingtext localid="pDedHxRayiFV" xmi.id="Znxj2kPJx0Tp"/> </messagewidget> <messagewidget localid="9gqCuDbbnSxI" textid="Znxj2kPJx0Tp" xmi.id="GCdCuRAwmemS" > <floatingtext localid="pDedHxRayiFV" xmi.id="Znxj2kPJx0Tp" /> </messagewidget>
(In reply to Ralf Habacker from comment #1) > Inspecting the xmi file from a save of the test case shows that the labels > shares the same localid The problem is that in bool UMLDragData::decodeClip4(const QMimeData* mimeData, UMLObjectList& objects, UMLWidgetList& widgets, AssociationWidgetList& associations, Uml::DiagramType::Enum &dType) only top level widgets are be patched to get a new localid // Generate a new unique 'local ID' so a second widget for the same // UMLObject can be distinguished from the first widget widget->setLocalID( doc->assignNewID(widget->localID()) ); but in bool MessageWidget::loadFromXMI(QDomElement& qElement) ... QString tag = element.tagName(); if (tag == QLatin1String("floatingtext") || tag == QLatin1String("UML::FloatingTextWidget")) { m_pFText = new FloatingTextWidget(m_scene, tr, operationText(m_scene), m_textId); m_scene->addFloatingTextWidget(m_pFText); if(! m_pFText->loadFromXMI(element)) { the related FloatingTextWidget fetches localid from the xml fragement bool UMLWidget::loadFromXMI(QDomElement & qElement) { ... QString localid = qElement.attribute(QLatin1String("localid"), QLatin1String("0")); if (localid != QLatin1String("0")) { m_nLocalID = Uml::ID::fromString(localid); }
Created attachment 89517 [details] Screenshot showing duplicated message
Further test shows that copying a message selects also the related object and pasting inserts the message AND the related object into the diagram (see screenshot). This issue seems to be related to Bug 340728.
(In reply to Ralf Habacker from comment #4) > Further test shows that copying a message selects also the related object > and pasting inserts the message AND the related object into the diagram. This behavior is required for pasting sequence diagram fragments into new diagrams not already having the related objects, but not for pasting into the current diagram.
Changed title according to the fact that synchronous and asynchronous messages are affected.
Git commit cd5dc9faad024ff5036b921ea7f6c5f9491de85b by Ralf Habacker. Committed on 13/11/2014 at 17:46. Pushed by habacker into branch 'Applications/14.12'. Fix bug 'Label position problem of copy and pasted messages'. The floating text widget assigned to a message pasted on sequence diagrams did not get a unique local id. FIXED-IN:4.14.95 M +8 -3 umbrello/clipboard/umldragdata.cpp http://commits.kde.org/umbrello/cd5dc9faad024ff5036b921ea7f6c5f9491de85b
reverted to 4.14.95. umbrello.kde.org version filter require this