[umbrello] [Bug 427532] On changing Code -> Active Language the previous default data types are not removed

Oliver Kellogg bugzilla_noreply at kde.org
Sun Oct 11 10:50:12 BST 2020


https://bugs.kde.org/show_bug.cgi?id=427532

Oliver Kellogg <okellogg at users.sourceforge.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|REPORTED                    |ASSIGNED

--- Comment #1 from Oliver Kellogg <okellogg at users.sourceforge.net> ---
We cannot remove the previous default data types from the Document (UMLDoc):

Imagine having made a large C++ specific model with Active Language C++.
Accidentally you change the Active Language to non C++.
If the default types were removed from the Document then all references to
those types would be left dangling.
Changing back to Active Language C++ would not fix the dangling references
because new default type objects would be constructed.

Therefore, the strategy is as follows:

* Class UMLDatatype gets a new flag, isActive, initialized to true by default.
* When user changes Active Language, before the new default types are added the
existing default types are queried at the Document and their isActive flag is
set false. No deallocation of those types is performed.
* The function UMLPackage::containedObjects is changed as follows: If a
contained object is a UMLDatatype then its isActive flag is queried. If
isActive is true then it is not placed into the returned list.
* When user changes Active Language back to its original value, the default
types of that language are queried at the Document and their isActive flag is
restored to true. The existing UMLDatatype objects are reused (no new
allocation takes place).
* The isActive flag is also saved to and loaded from the <UML:DataType> XMI
element.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the umbrello-devel mailing list