From 0a85c5b9fe3fbeceb4465e184be49d8963b3b1ee Mon Sep 17 00:00:00 2001 From: Andrey Paskal Date: Thu, 24 Dec 2009 19:17:23 +0300 Subject: [PATCH] Refactoring "Replace Nested Conditional with Guard Clauses" --- src/plugins/engine.cpp | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/plugins/engine.cpp b/src/plugins/engine.cpp index 220154e..cf4cc8e 100644 --- a/src/plugins/engine.cpp +++ b/src/plugins/engine.cpp @@ -696,18 +696,12 @@ aEngine::OpenForm(QString fname, int mode, aObject* selecter)//Q_ULLONG ido) aCfgItem object, form; form = md->find(fname); - if(!form.isNull()) - { - object = md->parent(md->parent(form)); - if(object.isNull()) return 0; - qulonglong ido =0; - if(selecter) ido = selecter->sysValue("id").toULongLong(); - return openForm(atoi(md->attr(object,mda_id)), atoi(md->attr(form,mda_id)), mode, mode, ido); - } - else - { - return 0; - } + if(form.isNull()) return 0; + object = md->parent(md->parent(form)); + if(object.isNull()) return 0; + qulonglong ido =0; + if(selecter) ido = selecter->sysValue("id").toULongLong(); + return openForm(atoi(md->attr(object,mda_id)), atoi(md->attr(form,mda_id)), mode, mode, ido); } -- 1.7.1