refactor assignment out of expression

Change-Id: Ief32b521eece3fde1a1de6782443ca6a098dee3d
Reviewed-on: https://gerrit.libreoffice.org/12992
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>