I've found another such tool which is less buggy and also has better support for C++ and even Java:
http://sourceforge.net/projects/astyle
(this is actually the same one used in KDevelop 3)
the only bad thing for this one:
it doesn't support like using "*.cpp" as parameter
