When creating the document window, we need to first check if the document
has been registered before. If so, we use the returned hierarchy and item id.
Merge branch 'bug_fix' into dev-3.0.0