Send a DispatchResult object with dispatch requests to the TOC.

This allows us to request a buffer update.
This commit is contained in:
Richard Kimberly Heck 2020-03-03 00:02:45 -05:00
parent 12bd688139
commit 37c5cae58b
5 changed files with 9 additions and 7 deletions

View File

@ -76,9 +76,10 @@ void GuiToc::closeEvent(QCloseEvent * /*event*/)
} }
void GuiToc::doDispatch(Cursor & cur, FuncRequest const & cmd) void GuiToc::doDispatch(Cursor & cur, FuncRequest const & cmd,
DispatchResult & dr)
{ {
widget_->doDispatch(cur, cmd); widget_->doDispatch(cur, cmd, dr);
} }

View File

@ -50,7 +50,7 @@ public:
/// ///
bool isBufferDependent() const { return true; } bool isBufferDependent() const { return true; }
/// ///
void doDispatch(Cursor & cur, FuncRequest const & fr); void doDispatch(Cursor & cur, FuncRequest const & fr, DispatchResult & dr);
/// ///
bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & fs) const; bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & fs) const;

View File

@ -3904,8 +3904,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
if (cmd.origin() == FuncRequest::TOC) { if (cmd.origin() == FuncRequest::TOC) {
GuiToc * toc = static_cast<GuiToc*>(findOrBuild("toc", false)); GuiToc * toc = static_cast<GuiToc*>(findOrBuild("toc", false));
// FIXME: do we need to pass a DispatchResult object here? toc->doDispatch(bv->cursor(), cmd, dr);
toc->doDispatch(bv->cursor(), cmd);
return; return;
} }

View File

@ -176,7 +176,8 @@ bool TocWidget::getStatus(Cursor & cur, FuncRequest const & cmd,
} }
void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd) void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd,
DispatchResult & dr)
{ {
Inset * inset = itemInset(); Inset * inset = itemInset();
@ -195,6 +196,7 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd)
case LFUN_CHANGE_REJECT: case LFUN_CHANGE_REJECT:
dispatch(item.action()); dispatch(item.action());
cur.dispatch(tmpcmd); cur.dispatch(tmpcmd);
dr.forceBufferUpdate();
break; break;
case LFUN_SECTION_SELECT: case LFUN_SECTION_SELECT:

View File

@ -39,7 +39,7 @@ public:
/// Initialise GUI. /// Initialise GUI.
void init(QString const & str); void init(QString const & str);
/// ///
void doDispatch(Cursor & cur, FuncRequest const & fr); void doDispatch(Cursor & cur, FuncRequest const & fr, DispatchResult & dr);
///send request to lyx::dispatch with proper guiview handle ///send request to lyx::dispatch with proper guiview handle
///(if ToC is detached current_view can be different window) ///(if ToC is detached current_view can be different window)
void sendDispatch(FuncRequest fr); void sendDispatch(FuncRequest fr);