aboutsummaryrefslogtreecommitdiffstats
path: root/src/diagram
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2017-12-19 22:47:05 +0100
committerNao Pross <naopross@thearcway.org>2017-12-19 22:47:05 +0100
commit631f37ee26c19d38408ee733ffda24ad283c7921 (patch)
tree0d12f7201337ac9c459aac48b5e4421f6a1f7db2 /src/diagram
parentUpdate gitignore for QtCreator (diff)
downloadOrbitingYeti-631f37ee26c19d38408ee733ffda24ad283c7921.tar.gz
OrbitingYeti-631f37ee26c19d38408ee733ffda24ad283c7921.zip
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
Diffstat (limited to 'src/diagram')
-rw-r--r--src/diagram/scope.cpp9
1 files changed, 1 insertions, 8 deletions
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());