Make NWDoc class non-reusable

This commit is contained in:
Veronica K. B. Olsen
2021-04-25 23:01:20 +02:00
parent fd28cbca4e
commit 470daf0036
8 changed files with 50 additions and 65 deletions
+5 -4
View File
@@ -107,10 +107,10 @@ class GuiDocMerge(QDialog):
)
return
theDoc = NWDoc(self.theProject)
theText = ""
for tHandle in finalOrder:
docText = theDoc.readDocument(tHandle).rstrip("\n")
inDoc = NWDoc(self.theProject, tHandle)
docText = inDoc.readDocument().rstrip("\n")
if docText:
theText += docText+"\n\n"
@@ -131,8 +131,9 @@ class GuiDocMerge(QDialog):
newItem = self.theProject.projTree[nHandle]
newItem.setStatus(srcItem.itemStatus)
theDoc.readDocument(nHandle)
theDoc.writeDocument(theText)
outDoc = NWDoc(self.theProject, nHandle)
outDoc.writeDocument(theText)
self.theParent.treeView.revealNewTreeItem(nHandle)
self.theParent.openDocument(nHandle, doScroll=True)