summaryrefslogtreecommitdiffstats
path: root/generator.cpp
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-11-19 15:02:34 -0200
committerHugo Lima <hugo.lima@openbossa.org>2009-11-19 15:02:34 -0200
commitaf0c620e6c74680db24e1bf1a400c48410cae418 (patch)
tree2d194dad829fa24ad252f72daf5929d139d6ef08 /generator.cpp
parent2946030013ebe8f80a5596a41b5f183c1b2efa58 (diff)
downloadgeneratorrunner-af0c620e6c74680db24e1bf1a400c48410cae418.tar.gz
generatorrunner-af0c620e6c74680db24e1bf1a400c48410cae418.tar.xz
generatorrunner-af0c620e6c74680db24e1bf1a400c48410cae418.zip
Fix the formatCode function (again).
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'generator.cpp')
-rw-r--r--generator.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/generator.cpp b/generator.cpp
index 77ad6b0..636eb5b 100644
--- a/generator.cpp
+++ b/generator.cpp
@@ -358,8 +358,9 @@ QTextStream& formatCode(QTextStream &s, const QString& code, Indentor &indentor)
foreach(QString line, lst) {
int limit = 0;
for(int i = 0; i < spacesToRemove; ++i) {
- if (line[i] == ' ')
- limit++;
+ if (!line[i].isSpace())
+ break;
+ limit++;
}
s << indentor << line.remove(0, limit) << endl;
}