src/toolsets/filetoolset.cpp

changeset 978
4603d8fd063e
parent 975
24ba5aa3393f
child 979
880d3fe9ac7c
--- a/src/toolsets/filetoolset.cpp	Mon Aug 31 23:36:08 2015 +0300
+++ b/src/toolsets/filetoolset.cpp	Sat Sep 05 23:03:24 2015 +0300
@@ -39,15 +39,15 @@
 
 	if (dlg->exec() == QDialog::Accepted)
 	{
-		newFile();
-		dlg->fillHeader (CurrentDocument());
+		m_window->createBlankDocument();
+		dlg->fillHeader (currentDocument());
 		m_window->doFullRefresh();
 	}
 }
 
 void FileToolset::newFile()
 {
-	newFile();
+	m_window->createBlankDocument();
 }
 
 void FileToolset::open()
@@ -62,26 +62,26 @@
 
 void FileToolset::save()
 {
-	m_window->save (CurrentDocument(), false);
+	m_window->save (currentDocument(), false);
 }
 
 void FileToolset::saveAs()
 {
-	m_window->save (CurrentDocument(), true);
+	m_window->save (currentDocument(), true);
 }
 
 void FileToolset::saveAll()
 {
-	for (LDDocument* file : LDDocument::explicitDocuments())
+	for (LDDocument* file : m_window->allDocuments())
 		m_window->save (file, false);
 }
 
 void FileToolset::close()
 {
-	if (not CurrentDocument()->isSafeToClose())
+	if (not currentDocument()->isSafeToClose())
 		return;
 
-	CurrentDocument()->dismiss();
+	currentDocument()->dismiss();
 }
 
 void FileToolset::closeAll()
@@ -128,11 +128,11 @@
 
 	LDObjectList objs = LoadFileContents (&f, null);
 
-	CurrentDocument()->clearSelection();
+	currentDocument()->clearSelection();
 
 	for (LDObject* obj : objs)
 	{
-		CurrentDocument()->insertObj (idx, obj);
+		currentDocument()->insertObj (idx, obj);
 		obj->select();
 		m_window->R()->compileObject (obj);
 
@@ -145,7 +145,7 @@
 
 void FileToolset::exportTo()
 {
-	if (Selection().isEmpty())
+	if (selectedObjects().isEmpty())
 		return;
 
 	QString fname = QFileDialog::getSaveFileName();
@@ -161,7 +161,7 @@
 		return;
 	}
 
-	for (LDObject* obj : Selection())
+	for (LDObject* obj : selectedObjects())
 	{
 		QString contents = obj->asText();
 		QByteArray data = contents.toUtf8();
@@ -177,7 +177,7 @@
 
 void FileToolset::openSubfiles()
 {
-	for (LDObject* obj : Selection())
+	for (LDObject* obj : selectedObjects())
 	{
 		LDSubfile* ref = dynamic_cast<LDSubfile*> (obj);
 

mercurial