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
This commit is contained in:
Abdelrazak Younes 2007-05-15 18:01:22 +00:00
parent 4912255342
commit ff19dcb49c
2 changed files with 6 additions and 6 deletions

View File

@ -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));
}

View File

@ -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);