Rename open and save document to read and write in NWDoc
This commit is contained in:
@@ -110,8 +110,9 @@ class GuiDocMerge(QDialog):
|
||||
theDoc = NWDoc(self.theProject, self.theParent)
|
||||
theText = ""
|
||||
for tHandle in finalOrder:
|
||||
theText += theDoc.openDocument(tHandle, False).rstrip("\n")
|
||||
theText += "\n\n"
|
||||
docText = theDoc.readDocument(tHandle, False).rstrip("\n")
|
||||
if docText:
|
||||
theText += docText+"\n\n"
|
||||
|
||||
if self.sourceItem is None:
|
||||
self.theParent.makeAlert(
|
||||
@@ -130,8 +131,8 @@ class GuiDocMerge(QDialog):
|
||||
newItem = self.theProject.projTree[nHandle]
|
||||
newItem.setStatus(srcItem.itemStatus)
|
||||
|
||||
theDoc.openDocument(nHandle, False)
|
||||
theDoc.saveDocument(theText)
|
||||
theDoc.readDocument(nHandle, False)
|
||||
theDoc.writeDocument(theText)
|
||||
self.theParent.treeView.revealNewTreeItem(nHandle)
|
||||
self.theParent.openDocument(nHandle, doScroll=True)
|
||||
|
||||
|
||||
+10
-5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user