]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetLine.cpp
Improve support for on screen length calculation
[lyx.git] / src / insets / InsetLine.cpp
index 353a24ef958a825c6e919f0039436c19cc5506e4..8b80f0d3ecbd29d96ae02bf665e030ae4e0109a1 100644 (file)
@@ -111,7 +111,7 @@ void InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const
        int const max_width = mi.base.textwidth;
 
        Length const width(to_ascii(getParam("width")));
-       dim.wid = width.inPixels(max_width, fm.width(char_type('M')));
+       dim.wid = width.inPixels(mi.base);
 
        // assure that the line inset is not outside of the window
        // check that it doesn't exceed the outer boundary
@@ -123,11 +123,11 @@ void InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const
        dim.wid = max(minw, abs(dim.wid));
 
        Length height = Length(to_ascii(getParam("height")));
-       height_ = height.inPixels(max_width, fm.width(char_type('M')));
+       height_ = height.inPixels(mi.base);
 
        // get the length of the parameters in pixels
        Length offset = Length(to_ascii(getParam("offset")));
-       offset_ = offset.inPixels(max_width, fm.width(char_type('M')));
+       offset_ = offset.inPixels(mi.base);
 
        dim.asc = max(fm.maxAscent(), offset_ + height_);
        dim.des = max(fm.maxDescent(), - offset_);
@@ -185,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;