]> git.lyx.org Git - lyx.git/blobdiff - src/lyxserver.C
small changes to ButtonController usage
[lyx.git] / src / lyxserver.C
index 28197299fb4e22e90470d977371f393253a97277..d0ad5c7ce2e9734c4a0349da9492f97bcc6b94a3 100644 (file)
@@ -5,7 +5,7 @@
  *           LyX, The Document Processor
  *        
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-1999 The LyX Team.
+ *           Copyright 1995-2000 The LyX Team.
  *
  * ====================================================== */
 
@@ -66,6 +66,8 @@
 #include "os2_errortable.h"
 #endif
 
+using std::endl;
+
 // provide an empty mkfifo() if we do not have one. This disables the
 // lyxserver. 
 #ifndef HAVE_MKFIFO
@@ -118,7 +120,7 @@ void LyXComm::openConnection() {
                lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n"
                       << "If no other LyX program is active, please delete"
                        " the pipe by hand and try again." << endl;
-               pipename.clear();
+               pipename.erase();
                return;
        }
 #ifndef __EMX__
@@ -169,7 +171,7 @@ void LyXComm::openConnection() {
                lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n"
                       << "If no other LyX program is active, please delete"
                        " the pipe by hand and try again." << endl;
-               pipename.clear();
+               pipename.erase();
                return;
        }
 #ifndef __EMX__
@@ -341,7 +343,7 @@ void LyXComm::callback(int fd, void *v)
                        {
                                lyxerr << "LyxComm: truncated command: " 
                                       << lsbuf << endl;
-                               lsbuf.clear();
+                               lsbuf.erase();
                        }
                        break; // reset connection
                }
@@ -428,6 +430,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
        bool server_only = false;
        while(*p) {
                // --- 1. check 'header' ---
+
                if (strncmp(p, "LYXSRV:", 7) == 0) {
                        server_only = true; 
                } else if(0!= strncmp(p, "LYXCMD:", 7)) {
@@ -495,7 +498,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
                                }
                                if (i < serv->numclients) {
                                        serv->numclients--;
-                                       serv->clients[i].clear();
+                                       serv->clients[i].erase();
                                        lyxerr[Debug::LYXSERVER]
                                                << "LyXServer: Client "
                                                << client << " said goodbye"
@@ -525,7 +528,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
                        string rval, buf;
                    
                        if (action>= 0) {
-                               rval = serv->func->Dispatch(cmd);
+                               rval = serv->func->Dispatch(action, arg.c_str());
                        } else {
                                rval = "Unknown command";
                        }