diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-02-06 16:44:47 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-02-06 16:44:47 +0100 |
commit | 0b39dfaf91658295e188c010127bafa468b76b4b (patch) | |
tree | abbcce107f4b01f277185ea8d294fe24111e0a7f /src/core | |
parent | 0376fdb483464ded73a5c1a8bba97b196af23b6d (diff) |
moved setRoot to Document.cpp
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/model/Document.cpp | 14 | ||||
-rw-r--r-- | src/core/model/Document.hpp | 9 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/core/model/Document.cpp b/src/core/model/Document.cpp index f27da1d..fedd899 100644 --- a/src/core/model/Document.cpp +++ b/src/core/model/Document.cpp @@ -716,6 +716,20 @@ bool Document::hasChild(Handle<StructureNode> s) const return false; } +void Document::setRoot(Handle<StructuredEntity> rt){ + if(rt == nullptr || root == rt){ + return; + } + if(root != nullptr){ + root->setParent(nullptr); + } + root = acquire(rt); + if (rt->getParent() != this) { + rt->setParent(this); + } + invalidate(); +} + /* Type registrations */ namespace RttiTypes { const Rtti Document = RttiBuilder<ousia::Document>("Document") diff --git a/src/core/model/Document.hpp b/src/core/model/Document.hpp index 35c6664..5235006 100644 --- a/src/core/model/Document.hpp +++ b/src/core/model/Document.hpp @@ -732,14 +732,7 @@ public: * parent of the given StructuredEntity if it is not set to this Document * already. */ - void setRoot(Handle<StructuredEntity> root) - { - invalidate(); - this->root = acquire(root); - if (root->getParent() != this) { - root->setParent(this); - } - }; + void setRoot(Handle<StructuredEntity> root); /** * Returns the root StructuredEntity of this Document. |