Summary: | Label position problem of copy and pasted messages | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Ralf Habacker <ralf.habacker> |
Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kde |
Priority: | NOR | ||
Version: | 2.14.2 (KDE Applications 4.14.2) | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 2.14.95 (KDE 14.11.95) | |
Sentry Crash Report: | |||
Attachments: | Screenshot showing duplicated message |
Description
Ralf Habacker
2014-11-07 10:01:38 UTC
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 |