]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommand.cpp
Make sure we center displayed equations.
[lyx.git] / src / insets / InsetCommand.cpp
index 319ab8a60b111a31352a6ee271d1e6365e073d24..fcda3cd2b984175a7cf24169adffb322c2a74095 100644 (file)
@@ -65,6 +65,20 @@ InsetCommand::InsetCommand(InsetCommand const & rhs)
 {}
 
 
+InsetCommand & InsetCommand::operator=(InsetCommand const & rhs)
+{
+       if (&rhs == this)
+               return *this;
+
+       Inset::operator=(rhs);
+       p_ = rhs.p_;
+       mouse_hover_.clear();
+       button_ = RenderButton();
+
+       return *this;
+}
+
+
 InsetCommand::~InsetCommand()
 {
        if (p_.code() != NO_CODE)
@@ -80,7 +94,7 @@ InsetCommand::~InsetCommand()
 
 void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       button_.update(screenLabel(), editable() || clickable(0, 0));
+       button_.update(screenLabel(), editable() || clickable(*mi.base.bv, 0, 0));
        button_.metrics(mi, dim);
 }
 
@@ -244,7 +258,7 @@ bool InsetCommand::string2params(string const & data,
        lex.setContext("InsetCommand::string2params");
        lex >> name.c_str(); // check for name
        lex >> "CommandInset";
-       params.read(lex, 0);
+       params.read(lex);
        return true;
 }