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
+8 -7
View File
@@ -127,8 +127,8 @@ class GuiDocSplit(QDialog):
)
return
theDoc = NWDoc(self.theProject)
theText = theDoc.readDocument(self.sourceItem)
inDoc = NWDoc(self.theProject, self.sourceItem)
theText = inDoc.readDocument()
if theText is None:
theText = ""
@@ -217,9 +217,10 @@ class GuiDocSplit(QDialog):
theText = "\n".join(theLines[iStart:iEnd])
theText = theText.rstrip("\n") + "\n\n"
theDoc.readDocument(nHandle)
theDoc.writeDocument(theText)
theDoc.clearDocument()
outDoc = NWDoc(self.theProject, nHandle)
outDoc.writeDocument(theText)
self.theParent.treeView.revealNewTreeItem(nHandle)
self._doClose()
@@ -259,8 +260,8 @@ class GuiDocSplit(QDialog):
return
self.listBox.clear()
theDoc = NWDoc(self.theProject)
theText = theDoc.readDocument(self.sourceItem)
inDoc = NWDoc(self.theProject, self.sourceItem)
theText = inDoc.readDocument()
if theText is None:
theText = ""