From 631f37ee26c19d38408ee733ffda24ad283c7921 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 19 Dec 2017 22:47:05 +0100 Subject: Implement basic ui Changes: - Clean up code to use Qt coding style - Add comments to some methods - Add debugtools to have debug_msg() and debug_err() macros - New Serializer class header to save / load data - MetadataDialog: check validity of metadata - MainWindow: initial code for `tool' buttons to edit the structogram - MainWindow: open / save dialog --- src/diagram/scope.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/diagram') diff --git a/src/diagram/scope.cpp b/src/diagram/scope.cpp index 5f6b4df..b0f56cf 100644 --- a/src/diagram/scope.cpp +++ b/src/diagram/scope.cpp @@ -17,8 +17,7 @@ Scope::iterator::~iterator() Scope::iterator& Scope::iterator::operator++() { - if (_current->next() == nullptr) - { + if (_current->next() == nullptr) { // TODO: remove throw throw std::logic_error("Statement::iterator::operator++() m_current->next() is nullptr"); } @@ -40,9 +39,7 @@ Scope::iterator& Scope::iterator::operator++(int) Statement& Scope::iterator::operator*() const { if (_current == nullptr) - { throw std::logic_error("Statement::iterator::operator*() m_current is nullptr"); - } return *_current; } @@ -76,9 +73,7 @@ Scope::~Scope() { Scope::iterator Scope::insert_after(Scope::iterator it, Statement::pointer statement) { if (statement == nullptr) - { throw std::invalid_argument("Statement::insert_after() cannot insert nullptr"); - } statement->next(it->next()); it->next(statement); @@ -91,9 +86,7 @@ Scope::iterator Scope::insert_after(Scope::iterator it, Statement::pointer state Scope::iterator Scope::erase_after(Scope::iterator it) { if (it->next() == nullptr) - { return end(); - } it->next(it->next()->next()); -- cgit v1.2.1