Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SDK
Umbrello
Commits
c4de1a6c
Commit
c4de1a6c
authored
Sep 08, 2013
by
Joris Steyn
Committed by
Ralf Habacker
Oct 06, 2013
Browse files
The problem with copy-pasting in the tree view is fixed.
BUG: 291749
FIXED-IN:4.11.3
parent
5dd307fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
umbrello/model_utils.cpp
View file @
c4de1a6c
...
...
@@ -383,22 +383,27 @@ UMLObject* treeViewGetCurrentObject()
/**
* Return the UMLPackage if the current item
* in the tree view is a package.
* in the tree view is a package. Return the
* closest package in the tree view or NULL otherwise
*
* @return the package or NULL
*/
UMLPackage
*
treeViewGetPackageFromCurrent
()
{
UMLListView
*
listView
=
UMLApp
::
app
()
->
listView
();
UMLListViewItem
*
parentItem
=
(
UMLListViewItem
*
)
listView
->
currentItem
();
if
(
parentItem
)
{
while
(
parentItem
)
{
UMLListViewItem
::
ListViewType
lvt
=
parentItem
->
type
();
if
(
Model_Utils
::
typeIsContainer
(
lvt
)
||
lvt
==
UMLListViewItem
::
lvt_Class
||
lvt
==
UMLListViewItem
::
lvt_Interface
)
{
if
(
Model_Utils
::
typeIsContainer
(
lvt
))
{
UMLObject
*
o
=
parentItem
->
umlObject
();
return
static_cast
<
UMLPackage
*>
(
o
);
}
// selected item is not a container, try to find the
// container higher up in the tree view
parentItem
=
static_cast
<
UMLListViewItem
*>
(
parentItem
->
parent
());
}
return
NULL
;
}
...
...
umbrello/umlobject.cpp
View file @
c4de1a6c
...
...
@@ -1068,6 +1068,7 @@ bool UMLObject::loadFromXMI(QDomElement & element)
m_BaseType
!=
ot_ForeignKeyConstraint
)
{
if
(
m_bInPaste
)
{
m_pUMLPackage
=
Model_Utils
::
treeViewGetPackageFromCurrent
();
this
->
setID
(
UniqueID
::
gen
());
}
if
(
m_pUMLPackage
)
{
m_pUMLPackage
->
addObject
(
this
);
...
...
umbrello/umlview.cpp
View file @
c4de1a6c
...
...
@@ -231,7 +231,9 @@ void UMLView::dragEnterEvent(QDragEnterEvent *e)
bAccept
=
false
;
break
;
case
Uml
::
DiagramType
::
EntityRelationship
:
if
(
ot
!=
UMLObject
::
ot_Entity
)
if
(
umlScene
()
->
widgetOnDiagram
(
id
)
||
(
ot
!=
UMLObject
::
ot_Entity
&&
ot
!=
UMLObject
::
ot_Category
))
bAccept
=
false
;
break
;
default:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment