]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetLine.cpp
Add Nomenclature to the TOC.
[lyx.git] / src / insets / InsetLine.cpp
index 515efbba4f50931ec144fbeb11a7285435e811c6..82960b262e338ffa118bed2d04c035fac6aaefb1 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")));
@@ -183,7 +185,8 @@ void InsetLine::latex(otexstream & os, OutputParams const &) const
 }
 
 
-int InsetLine::plaintext(odocstream & os, OutputParams const &) const
+int InsetLine::plaintext(odocstringstream & os,
+        OutputParams const &, size_t) const
 {
        os << "\n-------------------------------------------\n";
        return PLAINTEXT_NEWLINE;