Fraction: rewrite 'GetDenominator()==0' conditions

Change-Id: Ie42972db98da48b60b3f5314e019046b2a2ee0e7
Reviewed-on: https://gerrit.libreoffice.org/12238
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>