]> git.lyx.org Git - lyx.git/blobdiff - src/support/AppleScriptProxy.cpp
Check path of Qt tools if qtchooser is detected
[lyx.git] / src / support / AppleScriptProxy.cpp
index 23272e2caf967f775f389560cf3f6d756a1b494f..89a6eefc15b054bd28e9b78feacd6cf47fe347ea 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Full author contact details are available in file CREDITS.
  */
- #include <config.h>
+#include <config.h>
 
 #include "AppleScript.h"
 
 #include "support/docstring.h"
 #include "support/debug.h"
 
+#include <stdlib.h>
+
 using namespace std;
 using namespace lyx;
 
 extern "C" LyXFunctionResult applescript_execute_command(const char *cmd, const char *arg) {
-    LYXERR(Debug::ACTION, "Running command [" << cmd << "] with arguments [" << arg << "]");
-       FuncRequest fr(lyxaction.lookupFunc(cmd), arg);
+       LYXERR(Debug::ACTION, "Running command [" << cmd << "] with arguments [" << arg << "]");
+       FuncRequest fr(lyxaction.lookupFunc(cmd), from_utf8(arg));
        fr.setOrigin(FuncRequest::LYXSERVER);
        DispatchResult dr;
        theApp()->dispatch(fr, dr);
-       
-    string const rval = to_utf8(dr.message());
-    char *cstr =(char*)  malloc((rval.size()+1)*sizeof(rval[0]));
-    strcpy (cstr, rval.c_str());
-    
-    // Returns the result
-    LyXFunctionResult result;
-    result.code = dr.error() ? -1 : 0;
-    result.message = cstr;
-    
-    return result;
+
+       string const rval = to_utf8(dr.message());
+       char *cstr = (char*) malloc((rval.size()+1)*sizeof(rval[0]));
+       strcpy (cstr, rval.c_str());
+
+       // Returns the result
+       LyXFunctionResult result;
+       result.code = dr.error() ? -1 : 0;
+       result.message = cstr;
+
+       return result;
 }