DispatchResult Cursor::dispatch(FuncRequest const & cmd)
{
for (int i = data_.size() - 1; i >= 0; --i) {
- lyxerr << "trying to dispatch to inset" << data_[i].inset_ << endl;
- DispatchResult res = data_[i].inset_->dispatch(cmd);
- lyxerr << " result: " << res << endl;
+ CursorItem & citem = data_[i];
- if (res == DISPATCHED) {
- //update();
- return DISPATCHED;
- }
-
- if (res == DISPATCHED_NOUPDATE)
- return DISPATCHED;
+ lyxerr << "trying to dispatch to inset" << citem.inset_ << endl;
+ DispatchResult res = citem.inset_->dispatch(cmd);
+ lyxerr << " result: " << res.val() << endl;
- lyxerr << "# unhandled result: " << res << endl;
+ if (res.dispatched())
+ return res;
+
+ lyxerr << "# unhandled result: " << res.val() << endl;
}
- return UNDISPATCHED;
+ return DispatchResult(false);
}