[bug 75240] - reduced some variables' scope

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