tdf#153190 Compressing tool calculates compression rate wrong on large images

calculation used sal_Int32, which overflowed on large values, rather use
floating point to do the calculation

Change-Id: I15974c5bf785a800a8f71711acfa9895361bad7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150683
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit b167bc073b6b83110242bfbace107f6978e5bca7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150628
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit b09fdbb1250791b98e3da9edf16b4869bbdb0c94)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150633
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx
index f4f6e05..7e80b62 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -376,7 +376,11 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, CalculateClickHdl, weld::Button&, void 
    {
        OUString aSizeAsString = OUString::number(aSize / 1024);

        OUString aReductionSizeAsString = OUString::number( m_aNativeSize > 0 ? (m_aNativeSize - aSize) * 100 / m_aNativeSize : 0 );
        OUString aReductionSizeAsString;
        if (m_aNativeSize > 0 )
           aReductionSizeAsString = OUString::number( static_cast<sal_Int32>((m_aNativeSize - aSize) * 100.0 / m_aNativeSize) );
        else
           aReductionSizeAsString = "0";

        OUString aNewSizeString = SvxResId(STR_IMAGE_CAPACITY_WITH_REDUCTION);
        aNewSizeString = aNewSizeString.replaceAll("$(CAPACITY)", aSizeAsString);