summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-24 08:43:28 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-07-24 16:04:39 +0200
commit1733b527ac07fcb0067905e7277227f086b53afb (patch)
treef88ec1d8adb133243413e4ef6857dcc993ebf17a /sd/source
parent8213923c183c95c58b8c82ab6ad5e3f1611a4202 (diff)
cid#1451642 silence Division or modulo by zero
Change-Id: I728528ecbb69c23b63807944e4ae0beb9cb86cbb Reviewed-on: https://gerrit.libreoffice.org/76222 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 3add9902b8c7..2b426a632380 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -701,7 +701,9 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries,
sal_Int32 nValue = 0;
if( *pValues >>= nValue )
{
- Fraction aFract( pDoc->GetUIScale().GetNumerator(), nValue );
+ auto nNumerator = pDoc->GetUIScale().GetNumerator();
+ assert(nNumerator != 0);
+ Fraction aFract(nNumerator, nValue);
pDoc->SetUIScale( aFract );
bOk = true;
bChanged = true;