commit d1d3f755484d500550d70fc025e3a4a4e6c0a2a8 Author: Jean-Marc Lasgouttes <lasgout...@lyx.org> Date: Tue May 29 15:18:01 2018 +0200
Fixup dd79338c: avoid hypothetical division by zero Spotted by Coverity. --- src/frontends/qt4/GuiView.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 47a5688..4357389 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.