Partial fix for issue #24245.

This fix works for slurs starting and ending in the same voice.