diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-12-10 20:29:18 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-12-10 20:31:52 +0000 |
commit | afd1a6b516c634392b02beaed51e0ac2a9f877ce (patch) | |
tree | 7b75fa816efe8158d9f764544b7a56e3f498ef4e /editeng | |
parent | e068d96feceff19977454da6ad3390ad7f7ce507 (diff) |
ofz#4582 Floating-point-exception
Change-Id: I808022d970dc6e35839a032f4ebf024a48fadd11
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/textitem.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index e9ec28a812ec..5642f002f7e6 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -875,26 +875,30 @@ static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, M switch( eProp ) { case MapUnit::MapRelative: - nRet *= 100; - nRet /= nProp; - break; + if (nProp) + { + nRet *= 100; + nRet /= nProp; + } + break; case MapUnit::MapPoint: { short nTemp = (short)nProp; nDiff = nTemp * 20; if(!bCoreInTwip) nDiff = (short)convertTwipToMm100((long)nDiff); + break; } - break; case MapUnit::Map100thMM: //then the core is surely also in 1/100 mm nDiff = (short)nProp; - break; + break; case MapUnit::MapTwip: // Here surely TWIP nDiff = ((short)nProp); - break; - default: ;//prevent warning + break; + default: + break; } nRet = (nDiff < 0 || nRet >= static_cast<unsigned short>(nDiff)) ? nRet - nDiff : 0; |