Resolves fdo#54155: Crash when playing with a Group inside a Group

Cherry-picked from 7bd94d73ec56622685d0e23f8b5133ba110524be

Change-Id: I89c80fca1cdc8bc88172eaf8057141d5e42a06dc
Reviewed-on: https://gerrit.libreoffice.org/9910
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>