From: Abdelrazak Younes Date: Tue, 15 May 2007 18:01:22 +0000 (+0000) Subject: Fix assertion with LOF and LOT by transfering the test from TocWidget::select() to... X-Git-Tag: 1.6.10~9749 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ff19dcb49c41116aa9c8ecfe255ca759fd56b631;p=features.git Fix assertion with LOF and LOT by transfering the test from TocWidget::select() to QToc::getCurrentIndex(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18355 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/QToc.cpp b/src/frontends/qt4/QToc.cpp index 67f1c81c32..f27677fc58 100644 --- a/src/frontends/qt4/QToc.cpp +++ b/src/frontends/qt4/QToc.cpp @@ -81,6 +81,12 @@ QModelIndex const QToc::getCurrentIndex(int type) const if (type < 0) return QModelIndex(); + // FIXME: The TocBackend infrastructure is not ready for LOF and LOT + // This is because a proper ParConstIterator is not constructed in + // InsetCaption::addToToc() + if(!canOutline(type)) + return QModelIndex(); + return toc_models_[type]->modelIndex(getCurrentTocItem(type)); } diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp index 3edc839f54..7046dda2f2 100644 --- a/src/frontends/qt4/TocWidget.cpp +++ b/src/frontends/qt4/TocWidget.cpp @@ -206,12 +206,6 @@ void TocWidget::select(QModelIndex const & index) return; } - // FIXME: The TocBackend infrastructure is not ready for LOF and LOT - // This is because a proper ParConstIterator is not constructed in - // InsetCaption::addToToc() - if(!form_->canOutline(typeCO->currentIndex())) - return; - disconnectSelectionModel(); tocTV->setCurrentIndex(index); tocTV->scrollTo(index);