basically reintroduce the code deleted in
2e26ef34bf
and check at the right place the sign values
Change-Id: Idf613a3a087b428d1f85abe9b43342fb67538a63
Reviewed-on: https://gerrit.libreoffice.org/75488
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>