Fix bug where split document loses status or importance

This commit is contained in:
Veronica Berglyd Olsen
2022-10-30 17:07:24 +01:00
parent 1784d9ce28
commit c1988bcc17
+5 -1
View File
@@ -192,7 +192,7 @@ class DocSplitter:
"""An iterator that will write each document in the buffer, and """An iterator that will write each document in the buffer, and
return its new handle, parent handle, and sibling handle. return its new handle, parent handle, and sibling handle.
""" """
if self._srcHandle is None: if self._srcHandle is None or self._srcItem is None:
return return
pHandle = self._parHandle pHandle = self._parHandle
@@ -224,6 +224,10 @@ class DocSplitter:
dHandle = self.theProject.newFile(docLabel, pHandle) dHandle = self.theProject.newFile(docLabel, pHandle)
hHandle[hLevel] = dHandle hHandle[hLevel] = dHandle
newItem = self.theProject.tree[dHandle]
newItem.setStatus(self._srcItem.itemStatus)
newItem.setImport(self._srcItem.itemImport)
outDoc = NWDoc(self.theProject, dHandle) outDoc = NWDoc(self.theProject, dHandle)
status = outDoc.writeDocument("\n".join(docText)) status = outDoc.writeDocument("\n".join(docText))
if not status: if not status: