- func->dispatch(lyxaction.lookupFunc(cmd));
- string const rval = to_utf8(func->getMessage());
- if (func->errorStat()) {
+ FuncRequest fr(lyxaction.lookupFunc(cmd));
+ fr.setOrigin(FuncRequest::LYXSERVER);
+ DispatchResult dr;
+ theApp()->dispatch(fr, dr);
+ string const rval = to_utf8(dr.message());
+ if (dr.error())