Inset::translate() -> lyx::insetCode()

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20942 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-10-13 12:50:18 +00:00
parent fb306e4a90
commit 36e9a1fd30
5 changed files with 11 additions and 8 deletions

View File

@ -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);

View File

@ -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();

View File

@ -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

View File

@ -15,6 +15,8 @@
#ifndef INSETCODE_H
#define INSETCODE_H
#include <string>
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

View File

@ -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;
}