cppcheck: Fix redundant assignments in the sw module

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