Similar to doing this with the style uno command (.uno:StyleApply) in bug 106999, this is needed for the slide layout uno command (.uno:AssignLayout), which appears in the Slide > Slide Layout menu and the Slide Layout context menu, so that the user can see which layout is currently applied to the visible slide.
@Maxim: Got time to repeat your magic?