Inset * ins = cur.nextInset();
if (!ins)
break;
- docstring insname = ins->name();
+ docstring insname = ins->layoutName();
while (!insname.empty()) {
if (insname == name || name == from_utf8("*")) {
cur.recordUndo();
if (it->lyxCode() != FLEX_CODE)
// FIXME: Should we verify all InsetCollapsable?
continue;
- docstring const & n = newone->insetLayout(it->name()).name();
+
+ docstring const layoutName = it->layoutName();
+ docstring const & n = newone->insetLayout(layoutName).name();
bool const is_undefined = n.empty() ||
n == DocumentClass::plainInsetLayout().name();
if (!is_undefined)
docstring s;
if (oldname == newname)
s = bformat(_("Flex inset %1$s is undefined after "
- "reloading `%2$s' layout."),
- it->name(), oldname);
+ "reloading `%2$s' layout."), layoutName, oldname);
else
s = bformat(_("Flex inset %1$s is undefined because of "
"conversion from `%2$s' layout to `%3$s'."),
- it->name(), oldname, newname);
+ layoutName, oldname, newname);
// To warn the user that something had to be done.
errorlist.push_back(ErrorItem(
_("Undefined flex inset"),
{
if (!buffer_) {
odocstringstream s;
- lyxerr << "Inset: " << this
- << " LyX Code: " << lyxCode()
- << " name: " << insetName(lyxCode())
- << std::endl;
- s << "LyX Code: " << lyxCode() << " name: " << name();
+ string const iname = insetName(lyxCode());
+ LYXERR0("Inset: " << this << " LyX Code: " << lyxCode()
+ << " name: " << iname);
+ s << "LyX Code: " << lyxCode() << " name: " << iname;
LASSERT(false, /**/);
throw ExceptionMessage(BufferException,
from_ascii("Inset::buffer_ member not initialized!"), s.str());
}
-docstring Inset::name() const
+docstring Inset::layoutName() const
{
return from_ascii("unknown");
}
{
if (!buffer_)
return DocumentClass::plainInsetLayout();
- return buffer().params().documentClass().insetLayout(name());
+ return buffer().params().documentClass().insetLayout(layoutName());
}
virtual docstring contextMenuName() const;
- // FIXME This should really disappear in favor of
- // docstring name() const { return from_ascii(insetName(lyxCode()))); }
- // There's no reason to be using different names in different places.
- // But to do this we would need to change the file format, since the names
- // used there don't correspond to what is used here.
- ///
- virtual docstring name() const;
+ virtual docstring layoutName() const;
///
virtual InsetLayout const & getLayout() const;
/// Is this inset's layout defined in the document's textclass?
/// code of the inset
InsetCode lyxCode() const { return ARG_CODE; }
///
- docstring name() const { return from_ascii("Argument"); }
+ docstring layoutName() const { return from_ascii("Argument"); }
/// Standard LaTeX output -- short-circuited
void latex(otexstream &, OutputParams const &) const;
/// Standard plain text output -- short-circuited
{}
-docstring InsetBox::name() const
+docstring InsetBox::layoutName() const
{
// FIXME: UNICODE
string name = "Box";
///
InsetCode lyxCode() const { return BOX_CODE; }
///
- docstring name() const;
+ docstring layoutName() const;
///
void write(std::ostream &) const;
///
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
- docstring name() const { return from_ascii("Branch"); }
+ docstring layoutName() const { return from_ascii("Branch"); }
///
Inset * clone() const { return new InsetBranch(*this); }
}
-docstring InsetCaption::name() const
+docstring InsetCaption::layoutName() const
{
if (type_.empty())
return from_ascii("Caption");
///
std::string const & type() const { return type_; }
///
- docstring name() const;
+ docstring layoutName() const;
/// return the mandatory argument (LaTeX format) only
void getArgument(otexstream & os, OutputParams const &) const;
/// return the optional argument(s) only
///
docstring toolTip(BufferView const & bv, int x, int y) const;
///
- docstring name() const { return from_ascii("Collapsable"); }
+ docstring layoutName() const { return from_ascii("Collapsable"); }
///
void read(Lexer &);
///
///
InsetCode lyxCode() const { return ERT_CODE; }
///
- docstring name() const { return from_ascii("ERT"); }
+ docstring layoutName() const { return from_ascii("ERT"); }
///
void write(std::ostream & os) const;
///
///
InsetFlex(Buffer *, std::string const & layoutName);
///
- docstring name() const { return from_utf8(name_); }
+ docstring layoutName() const { return from_utf8(name_); }
///
InsetLayout const & getLayout() const;
///
}
-docstring InsetFloat::name() const
+docstring InsetFloat::layoutName() const
{
return "Float:" + from_utf8(params_.type);
}
InsetFloatParams const & params() const { return params_; }
private:
///
- docstring name() const;
+ docstring layoutName() const;
///
docstring toolTip(BufferView const & bv, int x, int y) const;
///
///
InsetCode lyxCode() const { return FOOT_CODE; }
///
- docstring name() const { return from_ascii("Foot"); }
+ docstring layoutName() const { return from_ascii("Foot"); }
///
void latex(otexstream &, OutputParams const &) const;
///
void InsetFootlike::write(ostream & os) const
{
- os << to_utf8(name()) << "\n";
+ os << to_utf8(layoutName()) << "\n";
InsetCollapsable::write(os);
}
void InsetIndex::write(ostream & os) const
{
- os << to_utf8(name());
+ os << to_utf8(layoutName());
params_.write(os);
InsetCollapsable::write(os);
}
///
InsetCode lyxCode() const { return INDEX_CODE; }
///
- docstring name() const { return from_ascii("Index"); }
+ docstring layoutName() const { return from_ascii("Index"); }
///
ColorCode labelColor() const;
///
}
-docstring InsetInfo::name() const
+docstring InsetInfo::layoutName() const
{
return from_ascii("Info:" + infoType());
}
///
InsetCode lyxCode() const { return INFO_CODE; }
///
- docstring name() const;
+ docstring layoutName() const;
///
Inset * editXY(Cursor & cur, int x, int y);
///
/// lstinline is inlined, normal listing is displayed
DisplayType display() const;
///
- docstring name() const { return from_ascii("Listings"); }
+ docstring layoutName() const { return from_ascii("Listings"); }
// Update the counters of this inset and of its contents
void updateBuffer(ParIterator const &, UpdateType);
///
///
InsetCode lyxCode() const { return MARGIN_CODE; }
///
- docstring name() const { return from_ascii("Marginal"); }
+ docstring layoutName() const { return from_ascii("Marginal"); }
///
int plaintext(odocstream &, OutputParams const & runparams) const;
///
}
-docstring InsetNote::name() const
+docstring InsetNote::layoutName() const
{
return from_ascii("Note:" + notetranslator().find(params_.type));
}
///
InsetCode lyxCode() const { return NOTE_CODE; }
///
- docstring name() const;
+ docstring layoutName() const;
///
DisplayType display() const;
/** returns false if, when outputing LaTeX, font changes should
}
-docstring InsetPhantom::name() const
+docstring InsetPhantom::layoutName() const
{
return from_ascii("Phantom:" + phantomtranslator().find(params_.type));
}
///
InsetCode lyxCode() const { return PHANTOM_CODE; }
///
- docstring name() const;
+ docstring layoutName() const;
///
void metrics(MetricsInfo &, Dimension &) const;
///
InsetCode lyxCode() const { return PREVIEW_CODE; }
- docstring name() const { return from_ascii("Preview"); }
+ docstring layoutName() const { return from_ascii("Preview"); }
bool descendable(BufferView const & /*bv*/) const { return true; }
}
-docstring InsetQuotes::name() const
+docstring InsetQuotes::layoutName() const
{
return from_ascii("Quotes");
}
/// Direct access to inner/outer quotation marks
InsetQuotes(Buffer * buf, char_type c, QuoteTimes t);
///
- docstring name() const;
+ docstring layoutName() const;
///
void metrics(MetricsInfo &, Dimension &) const;
///
}
-docstring InsetScript::name() const
+docstring InsetScript::layoutName() const
{
return from_ascii("script:" + scripttranslator().find(params_.type));
}
///
InsetCode lyxCode() const { return SCRIPT_CODE; }
///
- docstring name() const;
+ docstring layoutName() const;
///
DisplayType display() const;
///
}
-docstring InsetWrap::name() const
+docstring InsetWrap::layoutName() const
{
return "Wrap:" + from_utf8(params_.type);
}
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
- docstring name() const;
+ docstring layoutName() const;
///
Inset * clone() const { return new InsetWrap(*this); }
namespace lyx {
+docstring InsetMath::name() const
+{
+ return from_utf8("Unknown");
+}
+
+
MathData & InsetMath::cell(idx_type)
{
static MathData dummyCell(&buffer());
InsetMath const * asInsetMath() const { return this; }
/// this is overridden in math text insets (i.e. mbox)
bool inMathed() const { return true; }
+ ///
+ virtual docstring name() const;
/// this is overridden by specific insets
virtual mode_type currentMode() const { return MATH_MODE; }