From: Jean-Marc Lasgouttes Date: Tue, 29 May 2018 13:18:01 +0000 (+0200) Subject: Fixup dd79338c: avoid hypothetical division by zero X-Git-Tag: lyx-2.4.0dev-acb2ca7b~3388 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d1d3f755484d500550d70fc025e3a4a4e6c0a2a8;p=features.git Fixup dd79338c: avoid hypothetical division by zero Spotted by Coverity. --- diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 47a56882b1..435738957c 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -220,7 +220,7 @@ public: } // The longest line in the reference font (for English) // is 180. Calculate scale factor from that. - double const wscale = (180.0 / wline); + double const wscale = wline > 0 ? (180.0 / wline) : 1; // Now do the same for the height (necessary for condensed fonts) double const hscale = (34.0 / hline); // take the lower of the two scale factors.