]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetLine.cpp
Math.lyx, Tutorial.lyx: fix some typos spotted by a user
[lyx.git] / src / insets / InsetLine.cpp
index 515efbba4f50931ec144fbeb11a7285435e811c6..353a24ef958a825c6e919f0039436c19cc5506e4 100644 (file)
@@ -35,6 +35,8 @@
 #include "support/gettext.h"
 #include "support/lstrings.h"
 
+#include <cstdlib>
+
 using namespace std;
 
 namespace lyx {
@@ -118,10 +120,10 @@ void InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const
 
        // set a minimal width
        int const minw = (dim.wid < 0) ? 24 : 4;
-       dim.wid = max(minw, max(dim.wid, -dim.wid));
+       dim.wid = max(minw, abs(dim.wid));
 
        Length height = Length(to_ascii(getParam("height")));
-       height_ = height.inPixels(dim.height(), fm.width(char_type('M')));
+       height_ = height.inPixels(max_width, fm.width(char_type('M')));
 
        // get the length of the parameters in pixels
        Length offset = Length(to_ascii(getParam("offset")));