]> git.lyx.org Git - features.git/commitdiff
Send a DispatchResult object with dispatch requests to the TOC.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Tue, 3 Mar 2020 05:02:45 +0000 (00:02 -0500)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:53 +0000 (15:48 +0200)
This allows us to request a buffer update.

src/frontends/qt/GuiToc.cpp
src/frontends/qt/GuiToc.h
src/frontends/qt/GuiView.cpp
src/frontends/qt/TocWidget.cpp
src/frontends/qt/TocWidget.h

index e05152462011ec16d7f793f500254cb71f553753..793ee1efd20d5b13a557da453cae0921a17c27b4 100644 (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);
 }
 
 
index d403bc94f9b38a0d58541c494d71eb3295b4c05f..f29a9af59c8ffcc21db397e29acb08362a075ff7 100644 (file)
@@ -50,7 +50,7 @@ public:
        ///
        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;
 
index 1b98d989e19cf320f990377008d098f242e8b85f..6890c16ad4559eb9183f158a84b16b3e00d5b890 100644 (file)
@@ -3904,8 +3904,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
 
        if (cmd.origin() == FuncRequest::TOC) {
                GuiToc * toc = static_cast<GuiToc*>(findOrBuild("toc", false));
-               // FIXME: do we need to pass a DispatchResult object here?
-               toc->doDispatch(bv->cursor(), cmd);
+               toc->doDispatch(bv->cursor(), cmd, dr);
                return;
        }
 
index 7a13d9d684e0482e48922799cc92b1d3048d31dc..e90405dd18d7933d0ae0dd384cbf7b3d6f55ec06 100644 (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();
@@ -195,6 +196,7 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd)
        case LFUN_CHANGE_REJECT:
                dispatch(item.action());
                cur.dispatch(tmpcmd);
+               dr.forceBufferUpdate();
                break;
 
        case LFUN_SECTION_SELECT:
index 9cb21bfcbfc61f8b1ebdd9221de44f1aeed38efe..eff1d2b1d0c6a278c4f15795aa1a91512379fffe 100644 (file)
@@ -39,7 +39,7 @@ public:
        /// Initialise GUI.
        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
        ///(if ToC is detached current_view can be different window)
        void sendDispatch(FuncRequest fr);