summaryrefslogtreecommitdiff
path: root/src/core/model
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-06 16:44:47 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-06 16:44:47 +0100
commit0b39dfaf91658295e188c010127bafa468b76b4b (patch)
treeabbcce107f4b01f277185ea8d294fe24111e0a7f /src/core/model
parent0376fdb483464ded73a5c1a8bba97b196af23b6d (diff)
moved setRoot to Document.cpp
Diffstat (limited to 'src/core/model')
-rw-r--r--src/core/model/Document.cpp14
-rw-r--r--src/core/model/Document.hpp9
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.