From ff19dcb49c41116aa9c8ecfe255ca759fd56b631 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 15 May 2007 18:01:22 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/QToc.cpp | 6 ++++++ src/frontends/qt4/TocWidget.cpp | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) 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); -- 2.39.2