Resolves: fdo#82270 Grabbing focus can invalidate the entries

Change-Id: Ie9b4f936cebdcf2a37e66abef456c6b0c0e26201
(cherry picked from commit fef9bf4e39b041c7f13e4d1584e3086068e781fc)
Reviewed-on: https://gerrit.libreoffice.org/11878
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>