#include "FuncStatus.h"
#include "Lexer.h"
#include "MetricsInfo.h"
+#include "texstream.h"
#include "insets/InsetBox.h"
#include "insets/InsetBranch.h"
namespace lyx {
-// FIXME Would it now be possible to use the InsetCode in
+// FIXME Would it now be possible to use the InsetCode in
// place of the mailer name and recover that information?
InsetCommand::InsetCommand(Buffer * buf, InsetCommandParams const & p)
: Inset(buf), p_(p)
{}
+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)
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);
}
case LFUN_ERT_INSERT:
status.setEnabled(false);
return true;
-
+
// we handle these
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype") {
}
status.setEnabled(true);
return true;
-
+
case LFUN_INSET_DIALOG_UPDATE:
status.setEnabled(true);
return true;
-
+
default:
return Inset::getStatus(cur, cmd, status);
}
lex.setContext("InsetCommand::string2params");
lex >> name.c_str(); // check for name
lex >> "CommandInset";
- params.read(lex, 0);
+ params.read(lex);
return true;
}
break;
}
case MATH_SPACE_CODE: {
- InsetSpaceParams p(true);
+ InsetSpaceParams p(true);
data = InsetSpace::params2string(p);
break;
}