Only change the function definition, not the rest of the text, so that the user modifications to the function body would be preserved. The function definition gets updated every time the script page of the wizard is accessed.
Please comment on code style, I have used brace initialisation and
auto but I am not sure if that is allowed. All the code I was checking was 15+ years old, so C++11 feature weren't introduced yet.