diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-08-02 00:41:36 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:07 -0300 |
commit | f3b6eeccd43fc8b81bb7fe48424b6f4c6e4e454d (patch) | |
tree | 8d81173ee0eebf885946fe6ce7ca842a60afab18 /generator/cppgenerator.cpp | |
parent | cfcae8d657cb7d13acf2de753bd0e6db117e27f7 (diff) |
Removed unnecessary indentation from generated overload selector switch.
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
Reviewed by Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'generator/cppgenerator.cpp')
-rw-r--r-- | generator/cppgenerator.cpp | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index 5958e1583..6845d4f4f 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -1808,30 +1808,24 @@ void CppGenerator::writeFunctionCalls(QTextStream& s, const OverloadData& overlo { QList<const AbstractMetaFunction*> overloads = overloadData.overloadsWithoutRepetition(); s << INDENT << "// Call function/method" << endl; - s << INDENT << "{" << endl; + s << INDENT << (overloads.count() > 1 ? "switch (overloadId) " : "") << '{' << endl; { Indentation indent(INDENT); - - s << INDENT << (overloads.count() > 1 ? "switch (overloadId) " : "") << '{' << endl; - { - Indentation indent(INDENT); - if (overloads.count() == 1) { - writeSingleFunctionCall(s, overloadData, overloads.first()); - } else { - for (int i = 0; i < overloads.count(); i++) { - const AbstractMetaFunction* func = overloads.at(i); - s << INDENT << "case " << i << ": // " << func->minimalSignature() << endl; - s << INDENT << '{' << endl; - { - Indentation indent(INDENT); - writeSingleFunctionCall(s, overloadData, func); - s << INDENT << "break;" << endl; - } - s << INDENT << '}' << endl; + if (overloads.count() == 1) { + writeSingleFunctionCall(s, overloadData, overloads.first()); + } else { + for (int i = 0; i < overloads.count(); i++) { + const AbstractMetaFunction* func = overloads.at(i); + s << INDENT << "case " << i << ": // " << func->minimalSignature() << endl; + s << INDENT << '{' << endl; + { + Indentation indent(INDENT); + writeSingleFunctionCall(s, overloadData, func); + s << INDENT << "break;" << endl; } + s << INDENT << '}' << endl; } } - s << INDENT << '}' << endl; } s << INDENT << '}' << endl; } |