X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetCommand.cpp;h=879d9a35e06c56ead351199a55b8f67bdc787310;hb=d4550b7a4d64e9ff772cf3a7635cb4ca532fb340;hp=319ab8a60b111a31352a6ee271d1e6365e073d24;hpb=84cca2dd944cf11f8c69532dff91e9d91c8b2ab3;p=lyx.git diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index 319ab8a60b..879d9a35e0 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -21,6 +21,7 @@ #include "FuncStatus.h" #include "Lexer.h" #include "MetricsInfo.h" +#include "texstream.h" #include "insets/InsetBox.h" #include "insets/InsetBranch.h" @@ -65,6 +66,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 +95,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 +259,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; }