#include "support/lstrings.h"
-#include "frontends/Application.h"
#include "frontends/Painter.h"
#include "frontends/Selection.h"
#include "frontends/nullpainter.h"
+#include "funcrequest.h"
+#include "lyxserver.h"
+#include "lyxsocket.h"
+
#include <sstream>
using lyx::cap::copySelection;
using lyx::cap::replaceSelection;
using lyx::cap::selClearOrDel;
-using lyx::frontend::Clipboard;
-
using std::endl;
using std::string;
using std::istringstream;
break;
}
+ case LFUN_INSET_INSERT: {
+ MathArray ar;
+ if (createInsetMath_fromDialogStr(lyx::to_utf8(cmd.argument()), ar)) {
+ recordUndo(cur);
+ cur.insert(ar);
+ } else
+ cur.undispatched();
+ break;
+ }
+
default:
InsetMathDim::doDispatch(cur, cmd);
break;
flag.enabled(currentMode() == MATH_MODE);
break;
+ case LFUN_INSET_INSERT: {
+ // Don't test createMathInset_fromDialogStr(), since
+ // getStatus is not called with a valid reference and the
+ // dialog would not be applyable.
+ string const name = cmd.getArg(0);
+ flag.enabled(name == "ref");
+ break;
+ }
+
case LFUN_MATH_DELIM:
case LFUN_MATH_BIGDELIM:
// Don't do this with multi-cell selections
if (cur.selection())
asArray(lyx::to_utf8(bv.cursor().selectionAsString(false)), ar);
else
- asArray(lyx::to_utf8(theApp->selection().get()), ar);
+ asArray(lyx::to_utf8(theSelection().get()), ar);
cur.insert(ar);
bv.mouseSetCursor(cur);
//lyxerr << "## lfunMouseRelease: buttons: " << cmd.button() << endl;
if (cmd.button() == mouse_button::button1) {
- //theApp->selection().put(cur.grabSelection());
+ //theSelection().put(cur.grabSelection());
return;
}