Skip to content
Commit a8037fba authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

Followup to commit 5803dcd2 - add basic support for loading StarUML and...

Followup to commit 5803dcd2 - add basic support for loading StarUML and MagicDraw/Cameo while preserving load of native XMI:

umbrello/model_utils.{h,cpp}
- New function loadCommentFromXMI returns the text of an <ownedComment>
  UML2 element from a QDomElement. It attempts to read the attribute
  "body" and if that returns empty then attempts to read the text of the
  nested element <body>.

umbrello/umldoc.cpp
- In function loadFromXMI case outerTag "XMI" or "xmi:XMI" for-loop of
  node:
  - If outerTag stripped of namespace is "Model" or "Package" or
    "packagedElement" and the call to loadUMLObjectsFromXMI(element)
    returns false then do not return false.
    Reason: This gives better results on loading foreign XMI formats.
  - Support tagEq(tag, "DataType") alongside "Package", "Class", etc.
  - Support tagEq(tag, "ownedComment") using
    Model_Utils::loadCommentFromXMI(element).
- In function loadUMLObjectsFromXMI for-loop of node:
  1) Move up declaration of xmiType and setting of type from xmiType to
     before handling of tagEq(type, "Model").
  2) Remove test (type == "packagedElement"), it is obsoleted by 1).
  3) If loadUMLObjectsFromXMI(tempElement) returns false then do not
     return false.
     Reason: This gives better results on loading foreign XMI formats.
  4) Support loading of <ownedComment> using Model_Utils::
     loadCommentFromXMI(tempElement).
  5) If pObject->loadFromXMI(tempElement) returns false then do not
     return false.
     Reason: This gives better results on loading foreign XMI formats.

umbrello/umlmodel/umlobject.cpp
- In function loadFromXMI case element.hasChildNodes() while-loop of
  elem add loading of <ownedComment> using Model_Utils::
  loadCommentFromXMI(elem).

CCBUG: 56184
parent 098ed160
Loading
Loading
Loading
Pipeline #177349 passed with stage
in 10 minutes and 57 seconds
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment