From: Abdelrazak Younes Date: Sat, 13 Oct 2007 12:50:18 +0000 (+0000) Subject: Inset::translate() -> lyx::insetCode() X-Git-Tag: 1.6.10~7854 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=36e9a1fd30870cde3ef4a25c31fb4fafa4fc1ae6;p=features.git Inset::translate() -> lyx::insetCode() git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20942 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index ba730c81ba..e8c16577bf 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -1687,7 +1687,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) 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); diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp index 4401a0239b..603f61fee2 100644 --- a/src/insets/Inset.cpp +++ b/src/insets/Inset.cpp @@ -129,7 +129,7 @@ Dimension const Inset::dimension(BufferView const & bv) const } -InsetCode Inset::translate(std::string const & name) +InsetCode insetCode(std::string const & name) { static TranslatorMap const translator = build_translator(); diff --git a/src/insets/Inset.h b/src/insets/Inset.h index 3ab332fc46..6179e11990 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -266,11 +266,6 @@ public: /// 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 diff --git a/src/insets/InsetCode.h b/src/insets/InsetCode.h index 34801c1bdb..2dd7d79c67 100644 --- a/src/insets/InsetCode.h +++ b/src/insets/InsetCode.h @@ -15,6 +15,8 @@ #ifndef INSETCODE_H #define INSETCODE_H +#include + namespace lyx { /** This is not quite the correct place for this enum. I think @@ -125,6 +127,12 @@ enum InsetCode { 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 diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index a5bd3a6074..7041004107 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3753,7 +3753,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, 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; }