+
+
+WordLangTuple const
+InsetERT::selectNextWordToSpellcheck(BufferView * bv, float &) const
+{
+ bv->unlockInset(const_cast<InsetERT *>(this));
+ return WordLangTuple();
+}
+
+
+void InsetERT::getDrawFont(LyXFont & font) const
+{
+ LyXFont f(LyXFont::ALL_INHERIT, latex_language);
+ font = f;
+ font.setFamily(LyXFont::TYPEWRITER_FAMILY);
+ font.setColor(LColor::latex);
+}
+
+
+int InsetERT::getMaxWidth(BufferView * bv, UpdatableInset const * in) const
+{
+ int w = InsetCollapsable::getMaxWidth(bv, in);
+ if (status_ != Inlined || w < 0)
+ return w;
+ LyXText * text = inset.getLyXText(bv);
+ int rw = text->rows().begin()->width();
+ if (!rw)
+ rw = w;
+ rw += 40;
+ if (text->rows().size() == 1 && rw < w)
+ return -1;
+ return w;
+}
+
+
+void InsetERT::update(BufferView * bv, bool reinit)
+{
+ if (inset.need_update & InsetText::INIT ||
+ inset.need_update & InsetText::FULL) {
+ setButtonLabel();
+ }
+
+ InsetCollapsable::update(bv, reinit);
+}
+
+
+string const InsetERTMailer::name_("ert");
+
+InsetERTMailer::InsetERTMailer(InsetERT & inset)
+ : inset_(inset)
+{}
+
+
+string const InsetERTMailer::inset2string() const
+{
+ return params2string(inset_.status());
+}
+
+
+void InsetERTMailer::string2params(string const & in,
+ InsetERT::ERTStatus & status)
+{
+ status = InsetERT::Collapsed;
+
+ string name;
+ string body = split(in, name, ' ');
+
+ if (body.empty())
+ return;
+
+ status = static_cast<InsetERT::ERTStatus>(strToInt(body));
+}
+
+
+string const
+InsetERTMailer::params2string(InsetERT::ERTStatus status)
+{
+ return name_ + ' ' + tostr(status);
+}