Cut-paste and copy-paste corrected for point

What is the purpose of saving and restoring painter here? I guess it is not needed.