summaryrefslogtreecommitdiff
path: root/src/core/model/Document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/model/Document.cpp')
-rw-r--r--src/core/model/Document.cpp14
1 files changed, 14 insertions, 0 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")