: changeExtension(filename.absFilename(),
formats.extension(loader_format));
lv->view()->insertPlaintextFile(filename2, as_paragraphs);
- lv->dispatch(FuncRequest(LFUN_MARK_OFF), true);
+ theLyXFunc().setLyXView(lv);
+ lyx::dispatch(FuncRequest(LFUN_MARK_OFF));
}
// we are done
// Let the current LyXView dispatch its own actions.
BOOST_ASSERT(lyx_view_);
- if (lyx_view_->dispatch(cmd, false)) {
+ if (lyx_view_->dispatch(cmd)) {
if (lyx_view_->view())
updateFlags = lyx_view_->view()->cursor().result().update();
break;
/// \param propagate: indicate if the dispatch should be probagated to
/// the main lyx::dispatch().
/// \return true if the \c FuncRequest has been dispatched.
- virtual bool dispatch(FuncRequest const & cmd, bool propagate) = 0;
+ virtual bool dispatch(FuncRequest const & cmd) = 0;
///
virtual void restartCursor() = 0;
void Action::action()
{
//LYXERR(Debug::ACTION, "calling LyXFunc::dispatch: func_: ");
- lyxView_.dispatch(func_);
+ theLyXFunc().setLyXView(&lyxView_);
+ lyx::dispatch(func_);
triggered(this);
}
void Dialog::dispatch(FuncRequest const & fr) const
{
- lyxview_->dispatch(fr);
+ theLyXFunc().setLyXView(lyxview_);
+ lyx::dispatch(fr);
}
void GuiCommandBuffer::hide() const
{
FuncRequest cmd(LFUN_COMMAND_EXECUTE, "off");
- view_->dispatch(cmd);
+ theLyXFunc().setLyXView(view_);
+ lyx::dispatch(cmd);
}
history_pos_ = history_.end();
FuncRequest func = lyxaction.lookupFunc(str);
func.origin = FuncRequest::COMMANDBUFFER;
- view_->dispatch(func);
+ theLyXFunc().setLyXView(view_);
+ lyx::dispatch(func);
}
} // namespace frontend
LYXERR(Debug::GUI, "GuiToc::goTo " << to_utf8(it->str()));
string const tmp = convert<string>(it->id());
- lyxview().dispatch(FuncRequest(LFUN_PARAGRAPH_GOTO, tmp));
+ dispatch(FuncRequest(LFUN_PARAGRAPH_GOTO, tmp));
}
if (translateIfPossible(itname) == name) {
FuncRequest const func(LFUN_LAYOUT, itname,
FuncRequest::TOOLBAR);
- owner_.dispatch(func);
+ theLyXFunc().setLyXView(&owner_);
+ lyx::dispatch(func);
return;
}
}
}
-bool GuiView::dispatch(FuncRequest const & cmd, bool propagate)
+bool GuiView::dispatch(FuncRequest const & cmd)
{
BufferView * bv = view();
// By default we won't need any update.
}
default:
- if (propagate) {
- theLyXFunc().setLyXView(this);
- lyx::dispatch(cmd);
- }
return false;
}
- if (bv) {
- bv->processUpdateFlags(bv->cursor().result().update());
- // We won't need any new update.
- bv->cursor().updateFlags(Update::None);
- }
return true;
}
void updateToolbars();
QMenu * createPopupMenu();
FuncStatus getStatus(FuncRequest const & cmd);
- bool dispatch(FuncRequest const & cmd, bool propagate = true);
+ bool dispatch(FuncRequest const & cmd);
///
void setLayoutDialog(GuiLayoutBox *);
{
if (underMouse_) {
QString const data = QString("%1 %2").arg(bottom_).arg(right_);
- lyxView_.dispatch(FuncRequest(LFUN_TABULAR_INSERT, fromqstr(data)));
+ theLyXFunc().setLyXView(&lyxView_);
+ lyx::dispatch(FuncRequest(LFUN_TABULAR_INSERT, fromqstr(data)));
}
// emit signal
visible(false);