refactor

Wed, 04 Apr 2018 11:22:47 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Wed, 04 Apr 2018 11:22:47 +0300
changeset 1378
86e5a2259f58
parent 1377
0b9a946002be
child 1379
35811339ea72

refactor

src/mainwindow.cpp file | annotate | diff | comparison | revisions
--- a/src/mainwindow.cpp	Wed Apr 04 11:19:49 2018 +0300
+++ b/src/mainwindow.cpp	Wed Apr 04 11:22:47 2018 +0300
@@ -896,21 +896,23 @@
 	}
 }
 
-// ---------------------------------------------------------------------------------------------------------------------
-//
+/*
+ * Returns the currently open document.
+ */
 LDDocument* MainWindow::currentDocument()
 {
 	return m_currentDocument;
 }
 
-// ---------------------------------------------------------------------------------------------------------------------
-//
-// TODO: document may be null, this shouldn't be the case
-//
-void MainWindow::changeDocument (LDDocument* document)
+/*
+ * Changes the current document to the specified document.
+ */
+void MainWindow::changeDocument(LDDocument* document)
 {
+	Q_ASSERT(document != nullptr);
+
 	// Implicit files were loaded for caching purposes and may never be switched to.
-	if (document and document->isFrozen())
+	if (document->isFrozen())
 		return;
 
 	m_currentDocument = document;

mercurial