Rename open and save document to read and write in NWDoc

This commit is contained in:
Veronica K. B. Olsen
2021-04-25 17:10:12 +02:00
parent 1e48c6dcfe
commit d473615ccf
11 changed files with 67 additions and 59 deletions
+10 -5
View File
@@ -127,8 +127,11 @@ class GuiDocSplit(QDialog):
)
return
theDoc = NWDoc(self.theProject, self.theParent)
theText = theDoc.openDocument(self.sourceItem, False)
theDoc = NWDoc(self.theProject, self.theParent)
theText = theDoc.readDocument(self.sourceItem, False)
if theText is None:
theText = ""
theLines = theText.splitlines()
nLines = len(theLines)
theLines.insert(0, "%Split Doc")
@@ -214,8 +217,8 @@ class GuiDocSplit(QDialog):
theText = "\n".join(theLines[iStart:iEnd])
theText = theText.rstrip("\n") + "\n\n"
theDoc.openDocument(nHandle, False)
theDoc.saveDocument(theText)
theDoc.readDocument(nHandle, False)
theDoc.writeDocument(theText)
theDoc.clearDocument()
self.theParent.treeView.revealNewTreeItem(nHandle)
@@ -257,7 +260,9 @@ class GuiDocSplit(QDialog):
self.listBox.clear()
theDoc = NWDoc(self.theProject, self.theParent)
theText = theDoc.openDocument(self.sourceItem, False)
theText = theDoc.readDocument(self.sourceItem, False)
if theText is None:
theText = ""
spLevel = self.splitLevel.currentData()
self.optState.setValue("GuiDocSplit", "spLevel", spLevel)