]> git.lyx.org Git - features.git/commitdiff
TOC context menu (part 4)
authorVincent van Ravesteijn <vfr@lyx.org>
Thu, 9 Apr 2009 18:51:07 +0000 (18:51 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Thu, 9 Apr 2009 18:51:07 +0000 (18:51 +0000)
* TocWidget: Relay the LFUNs to the appropriate inset.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29165 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/TocWidget.cpp

index 3d4838a36ba2625702d0eed8444c7c5a84eee0d4..57b0282d1342052e6b7a0682c121f08309af50bd 100644 (file)
@@ -97,6 +97,17 @@ void TocWidget::showContextMenu(const QPoint & pos)
 
 void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd)
 {
+       QModelIndex const & index = tocTV->currentIndex();
+       TocItem const & item =
+               gui_view_.tocModels().currentItem(current_type_, index);
+       DocIterator const & dit = item.dit();
+       
+       Inset * inset = 0;
+       if (current_type_ == "label")
+               inset = dit.nextInset();
+
+       if (inset)
+               inset->dispatch(cur, FuncRequest(cmd));
 }