#include "math_mathmlstream.h"
#include "math_parser.h"
#include "BufferView.h"
+#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "LColor.h"
}
-bool MathNestInset::match(MathAtom const & at) const
-{
- if (nargs() != at->nargs())
- return false;
- for (idx_type i = 0; i < nargs(); ++i)
- if (!cell(i).match(at->cell(i)))
- return false;
- return true;
-}
-
-
void MathNestInset::replace(ReplaceData & rep)
{
for (idx_type i = 0; i < nargs(); ++i)
}
-dispatch_result MathNestInset::dispatch
- (FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+DispatchResult
+MathNestInset::priv_dispatch(FuncRequest const & cmd,
+ idx_type & idx, pos_type & pos)
{
BufferView * bv = cmd.view();
mathed_parse_cell(ar, cmd.argument);
cell(idx).insert(pos, ar);
pos += ar.size();
- return DISPATCHED;
+ return DispatchResult(true, true);
}
case LFUN_PASTESELECTION:
case LFUN_MOUSE_PRESS:
if (cmd.button() == mouse_button::button2)
- return dispatch(FuncRequest(bv, LFUN_PASTESELECTION), idx, pos);
- return UNDISPATCHED;
+ return priv_dispatch(FuncRequest(bv, LFUN_PASTESELECTION), idx, pos);
+ return DispatchResult(false);
default:
- return MathInset::dispatch(cmd, idx, pos);
+ return MathInset::priv_dispatch(cmd, idx, pos);
}
}
pi.pain.line(x, a, x + 3, a, LColor::mathframe);
pi.pain.line(t - 3, a, t, a, LColor::mathframe);
}
-
-