Do not reference a dangling OUString

Change-Id: I0908d1300d0d1acb515345ccbdf6cdc2bf44d6a5
(cherry picked from commit 151f3d665581d887cda1e36b817afb124c5c789e)
Reviewed-on: https://gerrit.libreoffice.org/8004
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>