]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetLine.cpp
InsetTabular.cpp: fix #6585 also for wrapped floats - thanks Vincent
[lyx.git] / src / insets / InsetLine.cpp
index 405e2be7dcc6cf805e7820f8332bd019acfe485d..2c88c061fd0c9853f9495fd0837b6179cce10f60 100644 (file)
@@ -3,6 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
+ * \author Abdelrazak Younes
  * \author André Pönitz
  * \author Uwe Stöhr
  *
@@ -41,7 +42,7 @@ using frontend::Painter;
 
 
 InsetLine::InsetLine(Buffer * buf, InsetCommandParams const & p)
-       : InsetCommand(buf, p, "line")
+       : InsetCommand(buf, p)
 {}
 
 
@@ -70,8 +71,7 @@ void InsetLine::doDispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_INSET_MODIFY: {
                InsetCommandParams p(LINE_CODE);
                // FIXME UNICODE
-               InsetCommand::string2params("line",
-                       to_utf8(cmd.argument()), p);
+               InsetCommand::string2params(to_utf8(cmd.argument()), p);
                if (p.getCmdName().empty()) {
                        cur.noScreenUpdate();
                        break;
@@ -125,8 +125,8 @@ void InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const
        Length offset = Length(to_ascii(getParam("offset")));
        offset_ = offset.inPixels(max_width, fm.width(char_type('M')));
 
-       dim.asc = max(fm.maxAscent(), offset_ + height_/2);
-       dim.des = max(fm.maxDescent(), height_/2 - offset_);
+       dim.asc = max(fm.maxAscent(), offset_ + height_);
+       dim.des = max(fm.maxDescent(), - offset_);
 
        // Cache the inset dimension
        setDimCache(mi, dim);