]> git.lyx.org Git - lyx.git/blobdiff - src/Server.cpp
support for the Iwona fonts
[lyx.git] / src / Server.cpp
index b6ae8d8b1fece30f7e71df4dea4b5213421e9c84..1de758a5f46bd1b9507c9e2ad9b213d9a015c550 100644 (file)
@@ -695,6 +695,7 @@ string const LyXComm::pipeName(DWORD index) const
 LyXComm::LyXComm(string const &, Server *, ClientCallbackfct)
 {}
 
+
 void LyXComm::openConnection()
 {}
 
@@ -716,6 +717,7 @@ void LyXComm::endPipe(int & fd, string const & filename, bool write)
 void LyXComm::emergencyCleanup()
 {}
 
+
 void LyXComm::read_ready()
 {}
 
@@ -726,7 +728,6 @@ void LyXComm::send(string const & msg)
 
 #else // defined (HAVE_MKFIFO)
 
-
 LyXComm::LyXComm(string const & pip, Server * cli, ClientCallbackfct ccb)
        : pipename_(pip), client_(cli), clientcb_(ccb)
 {
@@ -915,7 +916,6 @@ void LyXComm::read_ready()
        int status;
        // the single = is intended here.
        while ((status = ::read(infd_, charbuf, charbuf_size - 1))) {
-
                if (status > 0) {
                        charbuf[status] = '\0'; // turn it into a c string
                        read_buffer_ += rtrim(charbuf, "\r");
@@ -966,7 +966,8 @@ void LyXComm::send(string const & msg)
 
        LYXERR(Debug::LYXSERVER, "LyXComm: Sending '" << msg << '\'');
 
-       if (pipename_.empty()) return;
+       if (pipename_.empty())
+               return;
 
        if (!ready_) {
                LYXERR0("LyXComm: Pipes are closed. Could not send " << msg);
@@ -1015,7 +1016,8 @@ bool LyXComm::loadFilesInOtherInstance()
                        break;
                string const cmd = "LYXCMD:pipe:file-open:" +
                                        fname.absFileName() + '\n';
-               ::write(pipefd, cmd.c_str(), cmd.length());
+               if (::write(pipefd, cmd.c_str(), cmd.length()) < 0)
+                       LYXERR0("Cannot write to pipe!");
                ::close(pipefd);
                ++loaded_files;
                it = theFilesToLoad().erase(it);
@@ -1067,7 +1069,6 @@ Server::~Server()
 
 int compare(char const * a, char const * b, unsigned int len)
 {
-       using namespace std;
        return strncmp(a, b, len);
 }
 
@@ -1172,10 +1173,10 @@ void Server::callback(string const & msg)
                        // connect to the lyxfunc in the single GuiView we
                        // support currently. (Lgb)
 
-                       FuncRequest const fr(lyxaction.lookupFunc(cmd), arg);
+                       FuncRequest fr(lyxaction.lookupFunc(cmd), arg);
+                       fr.setOrigin(FuncRequest::LYXSERVER);
                        DispatchResult dr;
                        theApp()->dispatch(fr, dr);
-                       theApp()->dispatch(FuncRequest(LFUN_PARAGRAPH_UPDATE));
                        string const rval = to_utf8(dr.message());
 
                        // all commands produce an INFO or ERROR message