string action;
string const name = split(argument, action, ' ');
InsetCode const inset_code =
- Inset::translate(name);
+ insetCode(name);
Cursor & cur = view()->cursor();
FuncRequest fr(LFUN_INSET_TOGGLE, action);
}
-InsetCode Inset::translate(std::string const & name)
+InsetCode insetCode(std::string const & name)
{
static TranslatorMap const translator = build_translator();
/// return true if the inset should be removed automatically
virtual bool autoDelete() const;
- /** returns the InsetCode corresponding to the \c name.
- * Eg, translate("branch") == BRANCH_CODE
- */
- static InsetCode translate(std::string const & name);
-
/// returns true if the inset can hold an inset of given type
virtual bool insetAllowed(InsetCode) const { return false; }
/// if this inset has paragraphs should they be output all as default
#ifndef INSETCODE_H
#define INSETCODE_H
+#include <string>
+
namespace lyx {
/** This is not quite the correct place for this enum. I think
INFO_CODE,
};
+/** returns the InsetCode corresponding to the \c name.
+* Eg, translate("branch") == BRANCH_CODE
+* implemented in 'Inset.cpp'.
+*/
+InsetCode insetCode(std::string const & name);
+
} // namespace lyx
#endif
return cell(cur.idx())->getStatus(cur, cmd, status);
case LFUN_INSET_MODIFY:
- if (translate(cmd.getArg(0)) == TABULAR_CODE) {
+ if (insetCode(cmd.getArg(0)) == TABULAR_CODE) {
status.enabled(true);
return true;
}