[Libreoffice-commits] core.git: editeng/source

Caolán McNamara caolanm at redhat.com
Wed Nov 8 13:53:23 UTC 2017


 editeng/source/editeng/eertfpar.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 74564900e73e7d9ffc7acabe047ae151c3e02abf
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 8 11:15:11 2017 +0000

    ofz#4121 Floating-point-exception
    
    Change-Id: I32b52f1e2419ca56db0f4ee92cea39cec047c1c1
    Reviewed-on: https://gerrit.libreoffice.org/44455
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index 7affd086df70..428e76cc5e32 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -340,13 +340,17 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
     {
         // the correct one
         long nEsc = static_cast<const SvxEscapementItem*>(pItem)->GetEsc();
-
+        long nEscFontHeight = 0;
         if( ( DFLT_ESC_AUTO_SUPER != nEsc ) && ( DFLT_ESC_AUTO_SUB != nEsc ) )
         {
             nEsc *= 10; //HalfPoints => Twips was embezzled in RTFITEM.CXX!
             SvxFont aFont;
             mpEditEngine->SeekCursor(aStartPaM.GetNode(), aStartPaM.GetIndex()+1, aFont);
-            nEsc = nEsc * 100 / aFont.GetFontSize().Height();
+            nEscFontHeight = aFont.GetFontSize().Height();
+        }
+        if (nEscFontHeight)
+        {
+            nEsc = nEsc * 100 / nEscFontHeight;
 
             SvxEscapementItem aEscItem( (short) nEsc, static_cast<const SvxEscapementItem*>(pItem)->GetProportionalHeight(), EE_CHAR_ESCAPEMENT );
             rSet.GetAttrSet().Put( aEscItem );


More information about the Libreoffice-commits mailing list