coverity#1130443 Improper use of negative value

Change-Id: Ie56b1d5ceeb68bb3d7dffe6ad8949485a93e1fbb
(cherry picked from commit 0419524c57a7c18386c6cdc893a59fd95e589de9)
Reviewed-on: https://gerrit.libreoffice.org/7957
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>