sw: fix divide by 0

See https://crashreport.libreoffice.org/stats/signature/operator/(Fraction%20const%20&,Fraction%20const%20&)

Change-Id: Ia93e2969d6eb0bde71c8419f2aa90bb7aa231f61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150553
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 7073ce1..65f434d 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -914,8 +914,13 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
    }
    else
    {
        aArea.Width ( tools::Long( aArea.Width()  / pCli->GetScaleWidth() ) );
        aArea.Height( tools::Long( aArea.Height() / pCli->GetScaleHeight() ) );
        tools::Long nWidth(pCli->GetScaleWidth());
        tools::Long nHeight(pCli->GetScaleHeight());
        if (nWidth && nHeight)
        {
            aArea.Width ( aArea.Width()  / nWidth );
            aArea.Height( aArea.Height() / nHeight );
        }
    }

    pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight );