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.val() << endl;
+ CursorItem & citem = data_[i];
- if (res == DispatchResult(DISPATCHED)) {
- //update();
- return DispatchResult(DISPATCHED);
- }
+ lyxerr << "trying to dispatch to inset" << citem.inset_ << endl;
+ DispatchResult res = citem.inset_->dispatch(cmd);
+ lyxerr << " result: " << res.val() << endl;
- if (res == DispatchResult(DISPATCHED_NOUPDATE))
- return DispatchResult(DISPATCHED);
+ if (res.dispatched())
+ return res;
lyxerr << "# unhandled result: " << res.val() << endl;
}
- return DispatchResult(UNDISPATCHED);
+ return DispatchResult(false);
}