summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/dialog/compressgraphicdialog.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx
index 91399497c48e..a8be5ed6c5e8 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -377,7 +377,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);