]> git.lyx.org Git - lyx.git/blobdiff - src/LyXAction.C
Fixed the tth HTML export feature.
[lyx.git] / src / LyXAction.C
index 750312ff2803c2b9379235b0d19086e7c5399e76..15c535bd6bf36a694f774514b6eb48c99a8bbd52 100644 (file)
@@ -1,27 +1,28 @@
 /* This file is part of
-* ======================================================
-* 
-*           LyX, The Document Processor
-*       
-*          Copyright (C) 1995 Matthias Ettrich
-*           Copyright (C) 1995-1998 The LyX Team.
-*
-*======================================================*/
+ * ======================================================
+ 
+ *           LyX, The Document Processor
+ *      
+ *           Copyright 1995 Matthias Ettrich
+ *           Copyright 1995-1999 The LyX Team.
+ *
+ * ======================================================*/
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cctype>
+#include <cstring>
 
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
 #include "LyXAction.h"
-#include "error.h"
+#include "debug.h"
 #include "gettext.h"
+#include "support/lstrings.h"
 
  /*  
      NAMING RULES FOR USER-COMMANDS
@@ -451,10 +452,9 @@ int  LyXAction::searchActionArg(kb_action action, char const *arg)
        for (int i=0; i<psd_idx; i++) {
                if (action==tb->action && !strcmp(tb->name, arg)) {      
 
-                       lyxerr.debug(LString("Pseudoaction already exist[") 
-                                    + int(action) + '|' 
-                                    + PTR_AS_INT(arg) + ']',
-                                    Error::KEY);
+                       lyxerr[Debug::KEY] << "Pseudoaction already exist[" 
+                                          << action << '|' 
+                                          << arg << ']' << endl;
 
                        return LFUN_LASTACTION+i;
                }
@@ -473,8 +473,8 @@ int LyXAction::getPseudoAction(kb_action action, char const *arg)
        if (psdaction >= 0) return psdaction;
 
        if (psd_idx>=MAX_PSEUDO_ACTION) {
-               lyxerr.print("Lyx Error: No more pseudo-actions allowed");
-               lyxerr.print("           Tell the developers.");
+               lyxerr << "Lyx Error: No more pseudo-actions allowed"
+                      << "           Tell the developers." << endl;
                return -1;
        }
        lyx_func_args[psd_idx].name = strdup(arg);
@@ -492,7 +492,7 @@ int LyXAction::retrieveActionArg(int i, char const** arg)
                *arg = lyx_func_args[i].name;
                return (int)lyx_func_args[i].action;
        } else {
-               lyxerr.print("Lyx Error: Unrecognized pseudo-action");
+               lyxerr << "Lyx Error: Unrecognized pseudo-action" << endl;
                return -1;
        }
 }
@@ -525,9 +525,9 @@ int LyXAction::LookupFunc(char const *func)
        }
        if (arg && action >= 0) {
                action = getPseudoAction((kb_action)action, arg);
-               lyxerr.debug(LString("Pseudo action_arg[")
-                            + int(action) + '|' 
-                            + PTR_AS_INT(arg) + ']',Error::KEY);
+               lyxerr[Debug::KEY] << "Pseudo action_arg["
+                                  << action << '|' 
+                                  << arg << ']' << endl;
        }
        return action;
 }
@@ -709,7 +709,7 @@ char const *LyXAction::helpText(kb_action action) const
         if (helpTexts[action].action == action) {
            return helpTexts[action].name;
        } 
-       //        + LString(' ') + int(is_ro) + LString(']'));
+       //        + string(' ') + int(is_ro) + string(']'));
   no_desc:
        // In an ideal world, this never happens:
        return _("No description available!");
@@ -717,7 +717,7 @@ char const *LyXAction::helpText(kb_action action) const
 
 
 // Function to compare items from the attrib table.
-int actioncomp(const void *a, const void *b)
+extern "C" int actioncomp(const void *a, const void *b)
 {
     int const *ia=(int const*)a, *ib=(int const*)b;
     return (*ia)-(*ib);
@@ -748,8 +748,12 @@ bool LyXAction::isFuncRO(kb_action action) const
        } else
          if (k<0) l = m+1; else r = m;
     }
-    lyxerr.debug(LString("RO[") + int(action)
-                 + LString(" ") + int(is_ro) + LString("]"));
+    lyxerr.debug() << "RO[" << action
+                  << " " << is_ro << "]" << endl;
     return is_ro;
 }
 
+ostream & operator<<(ostream & o, kb_action action)
+{
+       return o << int(action);
+}