69cc7b
From cc369b3447da7f354901a79007b5db6f98379189 Mon Sep 17 00:00:00 2001
69cc7b
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
69cc7b
Date: Fri, 15 Sep 2017 16:17:21 +0100
69cc7b
Subject: [PATCH] Resolves: tdf#112408 crash with nan with bad ascent
69cc7b
69cc7b
bad ascent in the common case is probably fixed with tdf#107249
69cc7b
69cc7b
Change-Id: I0a06de06cb07277c50dcffd1b6a1121398e84e42
69cc7b
Reviewed-on: https://gerrit.libreoffice.org/42329
69cc7b
Reviewed-by: Michael Stahl <mstahl@redhat.com>
69cc7b
Tested-by: Jenkins <ci@libreoffice.org>
69cc7b
---
69cc7b
 sdext/source/presenter/PresenterTheme.cxx | 3 +++
69cc7b
 1 file changed, 3 insertions(+)
69cc7b
69cc7b
diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx
69cc7b
index 10c7cf0..5e60dde 100644
69cc7b
--- a/sdext/source/presenter/PresenterTheme.cxx
69cc7b
+++ b/sdext/source/presenter/PresenterTheme.cxx
69cc7b
@@ -570,6 +570,9 @@ double PresenterTheme::FontDescriptor::GetCellSizeForDesignSize (
69cc7b
     geometry::RealRectangle2D aBox (PresenterCanvasHelper::GetTextBoundingBox (xFont, "X"));
69cc7b
 
69cc7b
     const double nAscent (-aBox.Y1);
69cc7b
+    //tdf#112408
69cc7b
+    if (nAscent == 0)
69cc7b
+        return nDesignSize;
69cc7b
     const double nDescent (aBox.Y2);
69cc7b
     const double nScale = (nAscent+nDescent) / nAscent;
69cc7b
     return nDesignSize * nScale;
69cc7b
-- 
69cc7b
2.9.5
69cc7b