]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommand.cpp
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / InsetCommand.cpp
index c98ea20a872cc2981a9d38548b1f9e527c6f9142..f50d33c124e6d1ed806fb36482a58fc782c5fbec 100644 (file)
@@ -48,7 +48,7 @@ InsetCommand::~InsetCommand()
 }
 
 
-bool InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        if (updateButtonLabel_) {
                updateButtonLabel_ = false;
@@ -56,9 +56,6 @@ bool InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
                               editable() != NOT_EDITABLE);
        }
        button_.metrics(mi, dim);
-       bool const changed = dim_ != dim;
-       dim_ = dim;
-       return changed;
 }
 
 
@@ -71,7 +68,6 @@ bool InsetCommand::setMouseHover(bool mouse_hover)
 
 void InsetCommand::draw(PainterInfo & pi, int x, int y) const
 {
-       setPosCache(pi, x, y);
        button_.setRenderState(mouse_hover_);
        button_.draw(pi, x, y);
 }
@@ -132,8 +128,8 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
        }
 
        case LFUN_MOUSE_RELEASE: {
-               if (!mailer_name_.empty() && !cur.selection())
-                       InsetCommandMailer(mailer_name_, *this).showDialog(&cur.bv());
+               if (!cur.selection())
+                       edit(cur, true);
                break;
        }
 
@@ -165,6 +161,13 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
+void InsetCommand::edit(Cursor & cur, bool)
+{
+       if (!mailer_name_.empty())
+               InsetCommandMailer(mailer_name_, *this).showDialog(&cur.bv());
+}
+
+
 void InsetCommand::replaceContents(std::string const & from, string const & to)
 {
        if (getContents() == from)
@@ -205,7 +208,7 @@ void InsetCommandMailer::string2params(string const & name,
        // by Text::readInset
        string id;
        lex >> id;
-       if (!lex || id != "LatexCommand")
+       if (!lex || id != "CommandInset")
                return print_mailer_error("InsetCommandMailer", in, 2, "LatexCommand");
 
        params.read(lex);