Some cleanup. Even saves a few includes...

Ok?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)
Index: LyXAction.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LyXAction.C,v
retrieving revision 1.130
diff -u -p -r1.130 LyXAction.C
--- LyXAction.C 13 Aug 2002 17:43:36 -0000      1.130
+++ LyXAction.C 14 Aug 2002 09:53:16 -0000
@@ -16,8 +16,6 @@
 #include "gettext.h"
 #include "support/lstrings.h"
 
-#include <boost/tuple/tuple.hpp>
- 
 using std::ostream;
 using std::endl;
 using std::pair;
@@ -492,10 +490,10 @@ int LyXAction::getPseudoAction(kb_action
 }
 
 
-pair<kb_action, string> LyXAction::retrieveActionArg(int pseudo) const
+FuncRequest LyXAction::retrieveActionArg(int pseudo) const
 {
        if (!isPseudoAction(pseudo))
-               return make_pair(static_cast<kb_action>(pseudo), string());
+               return FuncRequest(static_cast<kb_action>(pseudo));
 
        pseudo_map::const_iterator pit = lyx_pseudo_map.find(pseudo);
 
@@ -503,11 +501,11 @@ pair<kb_action, string> LyXAction::retri
                lyxerr[Debug::ACTION] << "Found the pseudoaction: ["
                                      << pit->second.action << '|'
                                      << pit->second.argument << "]\n";
-               return make_pair(pit->second.action, pit->second.argument);
+               return pit->second;
        } else {
                lyxerr << "Lyx Error: Unrecognized pseudo-action "
                        << pseudo << endl;
-               return make_pair(LFUN_UNKNOWN_ACTION, string());
+               return FuncRequest(LFUN_UNKNOWN_ACTION);
        }
 }
 
@@ -537,36 +535,28 @@ int LyXAction::LookupFunc(string const &
 
 string const LyXAction::getActionName(int action) const
 {
-       kb_action ac;
-       string arg;
-       boost::tie(ac, arg) = retrieveActionArg(action);
- 
-       if (!arg.empty())
-               arg.insert(0, " ");
-
-       info_map::const_iterator iit = lyx_info_map.find(ac);
-
-       if (iit != lyx_info_map.end()) {
-               string ret(iit->second.name);
-               ret += arg;
-               return ret;
-       } else
-               return string();
+       FuncRequest ev = retrieveActionArg(action);
+       if (!ev.argument.empty())
+               ev.argument.insert(0, " ");
+
+       info_map::const_iterator iit = lyx_info_map.find(ev.action);
+
+       if (iit != lyx_info_map.end())
+               return iit->second.name + ev.argument;
+       return string();
 }
 
 
 string const LyXAction::helpText(int pseudoaction) const
 {
-       kb_action action;
-       string arg;
-       boost::tie(action, arg) = retrieveActionArg(pseudoaction);
+       FuncRequest ev = retrieveActionArg(pseudoaction);
 
        string help;
  
-       info_map::const_iterator ici = lyx_info_map.find(action);
+       info_map::const_iterator ici = lyx_info_map.find(ev.action);
        if (ici != lyx_info_map.end()) {
                if (lyxerr.debugging(Debug::ACTION)) {
-                       lyxerr << "Action: " << action << '\n';
+                       lyxerr << "Action: " << ev.action << '\n';
                        lyxerr << "   name: "
                               << ici->second.name << '\n';
                        lyxerr << " attrib: "
@@ -581,9 +571,9 @@ string const LyXAction::helpText(int pse
 
        if (help.empty()) {
                help = _("No description available!");
-       } else if (!arg.empty()) {
+       } else if (!ev.argument.empty()) {
                help += ' ';
-               help += arg;
+               help += ev.argument;
        }
 
        return help;
Index: LyXAction.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LyXAction.h,v
retrieving revision 1.18
diff -u -p -r1.18 LyXAction.h
--- LyXAction.h 8 Aug 2002 22:03:27 -0000       1.18
+++ LyXAction.h 14 Aug 2002 09:53:16 -0000
@@ -72,7 +72,7 @@ public:
         * Given a pseudo-action, return the real action and
         * associated argument
         */
-       std::pair<kb_action, string> retrieveActionArg(int pseudo) const;
+       FuncRequest retrieveActionArg(int pseudo) const;
 
        /// Search for an existent pseudoaction, return -1 if it doesn't exist.
        int searchActionArg(kb_action action, string const & arg) const;
Index: lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.366
diff -u -p -r1.366 lyxfunc.C
--- lyxfunc.C   13 Aug 2002 17:43:36 -0000      1.366
+++ lyxfunc.C   14 Aug 2002 09:53:16 -0000
@@ -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_a
 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
 
 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));
 }
 
 
@@ -703,10 +695,7 @@ void LyXFunc::dispatch(string const & s,
 
 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);
 }
 
 
@@ -1872,5 +1861,6 @@ string const LyXFunc::view_status_messag
 
 BufferView * LyXFunc::view() const
 {
+       lyx::Assert(owner);
        return owner->view().get();
 }
Index: frontends/xforms/Toolbar_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Toolbar_pimpl.C,v
retrieving revision 1.57
diff -u -p -r1.57 Toolbar_pimpl.C
--- frontends/xforms/Toolbar_pimpl.C    13 Aug 2002 17:43:38 -0000      1.57
+++ frontends/xforms/Toolbar_pimpl.C    14 Aug 2002 09:53:16 -0000
@@ -251,14 +251,11 @@ extern "C" {
 void setPixmap(FL_OBJECT * obj, int action, int buttonwidth, int height)
 {
        string xpm_name;
-
-       kb_action act;
-       string arg;
-       boost::tie(act, arg) = lyxaction.retrieveActionArg(action);
+       FuncRequest ev = lyxaction.retrieveActionArg(action);
  
-       string const name = lyxaction.getActionName(act);
-       if (!arg.empty())
-               xpm_name = subst(name + ' ' + arg, ' ','_');
+       string const name = lyxaction.getActionName(ev.action);
+       if (!ev.argument.empty())
+               xpm_name = subst(name + ' ' + ev.argument, ' ','_');
        else
                xpm_name = name;
 
@@ -271,8 +268,8 @@ void setPixmap(FL_OBJECT * obj, int acti
                return;
        }
 
-       if (act == LFUN_INSERT_MATH && !arg.empty()) {
-               char const ** pixmap = get_pixmap_from_symbol(arg.c_str(),
+       if (ev.action == LFUN_INSERT_MATH && !ev.argument.empty()) {
+               char const ** pixmap = get_pixmap_from_symbol(ev.argument.c_str(),
                                                              buttonwidth,
                                                              height);
                if (pixmap) {

Reply via email to