]> git.lyx.org Git - features.git/commitdiff
Inset::translate() -> lyx::insetCode()
authorAbdelrazak Younes <younes@lyx.org>
Sat, 13 Oct 2007 12:50:18 +0000 (12:50 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 13 Oct 2007 12:50:18 +0000 (12:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20942 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXFunc.cpp
src/insets/Inset.cpp
src/insets/Inset.h
src/insets/InsetCode.h
src/insets/InsetTabular.cpp

index ba730c81bad250d5f29d104e3cdfcebd12dbc416..e8c16577bf8f69b8fd7d3f6c7cf2851fc21cfdc9 100644 (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);
index 4401a0239b03a0d3fa4d38b75a2a49329adfcc19..603f61fee296d7d4711e7338523728a77b8c7220 100644 (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();
 
index 3ab332fc4665b43b6b4ad958a4021296de576606..6179e119905e2f4f929d5346a34293caab34d84f 100644 (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
index 34801c1bdb359cdb862c831c9e22d0a91ee976e6..2dd7d79c67c97c0324f34c126e61a0e464da5c1c 100644 (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
index a5bd3a60743f54840dda4a3790b6a5f2e810e4c3..7041004107d2ccc7221a7f7153384ecb551775e3 100644 (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;
                }