CppTools: Minor cleanup

Replace repetitive condition with switch-case statement.

Change-Id: Ib022d6970257d054f47229b70c1c0db4b6f2e80c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
CppTools: Pass const QString by reference

Change-Id: I3ad42095b7029cb58223a7bb7f9ce21dda29f50f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
CppEditor: Avoid repetitive function calls

Change-Id: I1f3e316336376887ec2e546fcb0cb714c777ee0b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>