<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>291749</bug_id>
          
          <creation_ts>2012-01-17 09:26:26 +0000</creation_ts>
          <short_desc>classes copy &amp; paste bug in Tree View</short_desc>
          <delta_ts>2013-11-10 23:40:53 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>umbrello</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Unlisted Binaries</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ralf Habacker">ralf.habacker</reporter>
          <assigned_to name="Joris Steyn">kde</assigned_to>
          <cc>kde</cc>
    
    <cc>okellogg</cc>
    
    <cc>ralf.habacker</cc>
          
          <cf_commitlink>http://commits.kde.org/umbrello/c4de1a6c78e8f8435aeb5f4ba6477ffdeedbef3d</cf_commitlink>
          <cf_versionfixedin>4.12.0</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1215445</commentid>
    <comment_count>0</comment_count>
    <who name="Ralf Habacker">ralf.habacker</who>
    <bug_when>2012-01-17 09:26:26 +0000</bug_when>
    <thetext>Version:           unspecified (using Devel) 
OS:                All

Copy and paste of a class in the Logical view results into an entry below the original entry with the same name from which it has been copied. 
Below the original class entry there is a new entry with the same name, which seems to be a separate class (one can add attributes and operations independently from the original class). 


Reproducible: Always

Steps to Reproduce:
1. Add a class to a class diagram
2. select the class in the tree view and press STRG-C then STRG-V


Actual Results:  
When dragging this class onto a class diagram, a class with the original class name is shown. It is impossible to add the pasted class into a class diagram.




Expected Results:  
The pasted class should be addable to the class diagram.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395818</commentid>
    <comment_count>1</comment_count>
      <attachid>82215</attachid>
    <who name="Joris Steyn">kde</who>
    <bug_when>2013-09-08 10:06:11 +0000</bug_when>
    <thetext>Created attachment 82215
Fix copy-paste bugs and inconsistencies in tree view</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395819</commentid>
    <comment_count>2</comment_count>
    <who name="Joris Steyn">kde</who>
    <bug_when>2013-09-08 10:06:43 +0000</bug_when>
    <thetext>The problem with copy-pasting in the tree view is not limited to the logical
view. Also, different behaviour can be observed depending on the type of item
copied and what item it&apos;s pasted on.

Issue 1: Classes and interfaces act as containers in tree view
Copy/paste of a class or interface on itself results in a nested hierarchy:
-&gt; Logical View
-&gt;-&gt; new_class
-&gt;-&gt;-&gt; new_class
This container-like behaviour is only implemented in the tree view, and only
when pasting the items on itself. I&apos;ll assume pasted classes and interfaces
should always be siblings, never children (except when pasted on true
containers like folders, packages, etc).

Issue 2: Inconsistent rename behaviour
When pasting an item (for example, an actor in a use case diagram) on itself, a
new item is created with the exact same name. This is different from pasting on
the container (the Use Case View in this example) where the rename dialog is
shown. 

Issue 3: Unable to drag all items onto the diagram
Either original or pasted items can be dragged onto the diagram, but not both.

Attached patch fixes these three issues and a slightly related bug where
categories could not be dragged onto ER models.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395878</commentid>
    <comment_count>3</comment_count>
    <who name="Oliver Kellogg">okellogg</who>
    <bug_when>2013-09-08 17:04:32 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; The problem with copy-pasting in the tree view is not limited to the logical
&gt; view. Also, different behaviour can be observed depending on the type of item
&gt; copied and what item it&apos;s pasted on.
&gt; 
&gt; Issue 1: Classes and interfaces act as containers in tree view
&gt; Copy/paste of a class or interface on itself results in a nested hierarchy:
&gt; -&gt; Logical View
&gt; -&gt;-&gt; new_class
&gt; -&gt;-&gt;-&gt; new_class
&gt; This container-like behaviour is only implemented in the tree view, and only
&gt; when pasting the items on itself. I&apos;ll assume pasted classes and interfaces
&gt; should always be siblings, never children (except when pasted on true
&gt; containers like folders, packages, etc).

Actually, years ago there had been enhancement requests to support nested classes, and the existing code was implementing that. Back in the old KDE3 days it did work - but some time later (most likely in the course of migrating to KDE4) it broke, and nobody has fixed it again.

Thanks for your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1396083</commentid>
    <comment_count>4</comment_count>
    <who name="Andi Fischer">andi.fischer</who>
    <bug_when>2013-09-09 17:53:29 +0000</bug_when>
    <thetext>Git commit c63e77ca04b691b304a391d5b926ac0f0667e974 by Andi Fischer, on behalf of Joris Steyn.
Committed on 08/09/2013 at 19:12.
Pushed by fischer into branch &apos;master&apos;.

The problem with copy-pasting in the tree view is fixed.

M  +10   -5    umbrello/model_utils.cpp
M  +1    -0    umbrello/umlobject.cpp
M  +3    -1    umbrello/umlview.cpp

http://commits.kde.org/umbrello/c63e77ca04b691b304a391d5b926ac0f0667e974</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401771</commentid>
    <comment_count>5</comment_count>
    <who name="Ralf Habacker">ralf.habacker</who>
    <bug_when>2013-10-06 12:21:07 +0000</bug_when>
    <thetext>Git commit c4de1a6c78e8f8435aeb5f4ba6477ffdeedbef3d by Ralf Habacker, on behalf of Joris Steyn.
Committed on 08/09/2013 at 19:12.
Pushed by habacker into branch &apos;KDE/4.11&apos;.

The problem with copy-pasting in the tree view is fixed.
FIXED-IN:4.11.3

M  +10   -5    umbrello/model_utils.cpp
M  +1    -0    umbrello/umlobject.cpp
M  +3    -1    umbrello/umlview.cpp

http://commits.kde.org/umbrello/c4de1a6c78e8f8435aeb5f4ba6477ffdeedbef3d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1410432</commentid>
    <comment_count>6</comment_count>
    <who name="Joris Steyn">kde</who>
    <bug_when>2013-11-10 19:20:34 +0000</bug_when>
    <thetext>Git commit 1bfad17b6e6891a316ea56ac906980175ae5a058 by Joris Steyn.
Committed on 13/10/2013 at 15:09.
Pushed by jorissteyn into branch &apos;master&apos;.

Fix copy/paste between Umbrello instances

Clip4 now contains all the UMLObjects corresponding to the copied widgets.

Some related but obviously unused code removed. Involves a better fix than
c63e77c for broken copy/paste of listview items.
Related: bug 70926, bug 279788, bug 195803, bug 128068

M  +7    -48   umbrello/clipboard/umlclipboard.cpp
M  +18   -14   umbrello/clipboard/umldragdata.cpp
M  +6    -0    umbrello/uml.cpp
M  +0    -111  umbrello/umllistview.cpp
M  +0    -5    umbrello/umllistview.h
M  +1    -2    umbrello/umlobject.cpp

http://commits.kde.org/umbrello/1bfad17b6e6891a316ea56ac906980175ae5a058</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1410477</commentid>
    <comment_count>7</comment_count>
    <who name="Ralf Habacker">ralf.habacker</who>
    <bug_when>2013-11-10 23:40:53 +0000</bug_when>
    <thetext>Git commit 9b2d14372905fc49076025488983fb5859637eba by Ralf Habacker, on behalf of Joris Steyn.
Committed on 13/10/2013 at 15:09.
Pushed by habacker into branch &apos;KDE/4.12&apos;.

Fix copy/paste between Umbrello instances

Clip4 now contains all the UMLObjects corresponding to the copied widgets.

Some related but obviously unused code removed. Involves a better fix than
c63e77c for broken copy/paste of listview items.
Related: bug 70926, bug 279788, bug 195803, bug 128068

M  +7    -48   umbrello/clipboard/umlclipboard.cpp
M  +18   -14   umbrello/clipboard/umldragdata.cpp
M  +6    -0    umbrello/uml.cpp
M  +0    -111  umbrello/umllistview.cpp
M  +0    -5    umbrello/umllistview.h
M  +1    -2    umbrello/umlobject.cpp

http://commits.kde.org/umbrello/9b2d14372905fc49076025488983fb5859637eba</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>82215</attachid>
            <date>2013-09-08 10:06:11 +0000</date>
            <delta_ts>2013-09-08 10:06:11 +0000</delta_ts>
            <desc>Fix copy-paste bugs and inconsistencies in tree view</desc>
            <filename>umbrello-fix-copy-paste-in-tree-view-bug-291749.patch</filename>
            <type>text/plain</type>
            <size>2367</size>
            <attacher name="Joris Steyn">kde</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL3VtYnJlbGxvL21vZGVsX3V0aWxzLmNwcCBiL3VtYnJlbGxvL21vZGVsX3V0
aWxzLmNwcAppbmRleCA2ZjQxNDgyLi42YjllMDg5IDEwMDY0NAotLS0gYS91bWJyZWxsby9tb2Rl
bF91dGlscy5jcHAKKysrIGIvdW1icmVsbG8vbW9kZWxfdXRpbHMuY3BwCkBAIC0zODMsMjIgKzM4
MywyNyBAQCBVTUxPYmplY3QqIHRyZWVWaWV3R2V0Q3VycmVudE9iamVjdCgpCiAKIC8qKgogICog
UmV0dXJuIHRoZSBVTUxQYWNrYWdlIGlmIHRoZSBjdXJyZW50IGl0ZW0KLSAqIGluIHRoZSB0cmVl
IHZpZXcgaXMgYSBwYWNrYWdlLgorICogaW4gdGhlIHRyZWUgdmlldyBpcyBhIHBhY2thZ2UuIFJl
dHVybiB0aGUKKyAqIGNsb3Nlc3QgcGFja2FnZSBpbiB0aGUgdHJlZSB2aWV3IG9yIE5VTEwgb3Ro
ZXJ3aXNlCisgKgogICogQHJldHVybiAgIHRoZSBwYWNrYWdlIG9yIE5VTEwKICAqLwogVU1MUGFj
a2FnZSogdHJlZVZpZXdHZXRQYWNrYWdlRnJvbUN1cnJlbnQoKQogewogICAgIFVNTExpc3RWaWV3
ICpsaXN0VmlldyA9IFVNTEFwcDo6YXBwKCktPmxpc3RWaWV3KCk7CiAgICAgVU1MTGlzdFZpZXdJ
dGVtICpwYXJlbnRJdGVtID0gKFVNTExpc3RWaWV3SXRlbSopbGlzdFZpZXctPmN1cnJlb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l0eSAmJgorICAgICAgICAgICAgICAgICBvdCAhPSBVTUxPYmplY3Q6
Om90X0NhdGVnb3J5KSkKICAgICAgICAgICAgICAgICBiQWNjZXB0ID0gZmFsc2U7CiAgICAgICAg
ICAgICBicmVhazsKICAgICAgICAgZGVmYXVsdDoK
</data>

          </attachment>
      

    </bug>

</bugzilla>