]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
remove unused code
[lyx.git] / src / lyxfunc.C
index d427716ac54f4e4f7fc445a16941162281b68264..61ffa58b04849f98aed0a01fb1972009ee7441fb 100644 (file)
@@ -90,8 +90,6 @@
 #include "support/path.h"
 #include "support/lyxfunctional.h"
 
-#include <boost/tuple/tuple.hpp>
-
 #include <ctime>
 #include <clocale>
 #include <cstdlib>
@@ -120,9 +118,6 @@ extern tex_accent_struct get_accent(kb_action action);
 extern void ShowLatexLog();
 
 
-/* === globals =========================================================== */
-
-
 LyXFunc::LyXFunc(LyXView * o)
        : owner(o),
        keyseq(toplevel_keymap.get(), toplevel_keymap.get()),
@@ -274,10 +269,7 @@ void LyXFunc::processKeySym(LyXKeySymPtr keysym,
 
 FuncStatus LyXFunc::getStatus(int ac) const
 {
-       kb_action action;
-       string arg;
-       boost::tie(action, arg) = lyxaction.retrieveActionArg(ac);
-       return getStatus(FuncRequest(view(), action, arg));
+       return getStatus(lyxaction.retrieveActionArg(ac));
 }
 
 
@@ -425,7 +417,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
                disable = !IsFileReadable(buf->getLogName().second);
                break;
        case LFUN_MATH_VALIGN:
-               if (mathcursor && mathcursor->formula()->hullType() != "simple") {
+               if (mathcursor) {
                        char align = mathcursor->valign();
                        if (align == '\0') {
                                disable = true;
@@ -445,7 +437,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
                break;
 
        case LFUN_MATH_HALIGN:
-               if (mathcursor && mathcursor->formula()->hullType() != "simple") {
+               if (mathcursor) {
                        char align = mathcursor->halign();
                        if (align == '\0') {
                                disable = true;
@@ -465,8 +457,9 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
                break;
 
        case LFUN_MATH_MUTATE:
-               if (tli && (tli->lyxCode() == Inset::MATH_CODE))
-                       flag.setOnOff(mathcursor->formula()->hullType() == ev.argument);
+               if (mathcursor)
+                       //flag.setOnOff(mathcursor->formula()->hullType() == ev.argument);
+                       flag.setOnOff(false);
                else
                        disable = true;
                break;
@@ -477,6 +470,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
        case LFUN_MATH_LIMITS:
        case LFUN_MATH_NONUMBER:
        case LFUN_MATH_NUMBER:
+       case LFUN_MATH_EXTERN:
                disable = !mathcursor;
                break;
 
@@ -486,8 +480,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
        case LFUN_MATH_ROW_DELETE:
        case LFUN_MATH_COLUMN_INSERT:
        case LFUN_MATH_COLUMN_DELETE:
-               disable = !mathcursor || !mathcursor->halign() ||
-                       mathcursor->formula()->hullType() == "simple";
+               disable = !mathcursor || !mathcursor->halign();
                break;
 
        default:
@@ -703,10 +696,7 @@ void LyXFunc::dispatch(string const & s, bool verbose)
 
 void LyXFunc::dispatch(int ac, bool verbose)
 {
-       kb_action action;
-       string arg;
-       boost::tie(action, arg) = lyxaction.retrieveActionArg(ac);
-       dispatch(FuncRequest(view(), action, arg), verbose);
+       dispatch(lyxaction.retrieveActionArg(ac), verbose);
 }
 
 
@@ -746,7 +736,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
        }
 
        if (view()->available() && view()->theLockingInset()) {
-               UpdatableInset::RESULT result;
+               Inset::RESULT result;
                if ((action > 1) || ((action == LFUN_UNKNOWN_ACTION) &&
                                     (!keyseq.deleted())))
                {
@@ -1872,5 +1862,6 @@ string const LyXFunc::view_status_message()
 
 BufferView * LyXFunc::view() const
 {
+       lyx::Assert(owner);
        return owner->view().get();
 }