int QToc::getTocDepth()
{
+ if (type_ < 0)
+ return 0;
return toc_models_[type_]->modelDepth();
}
QModelIndex const QToc::getCurrentIndex()
{
vector<string> const & types = getTypes();
+ if (types.empty() || type_ < 0)
+ return QModelIndex();
+
TocIterator const it = getCurrentTocItem(types[type_]);
if (it == getContents(types[type_]).end() || !it->isValid()) {
lyxerr[Debug::GUI] << "QToc::getCurrentIndex(): TocItem is invalid!" << endl;
return;
}
+ BOOST_ASSERT(type_ >= 0 && type_ < int(toc_models_.size()));
+
TocIterator const it = toc_models_[type_]->tocIterator(index);
lyxerr[Debug::GUI]
selected_type = to_ascii(params()["type"]);
QString gui_names_;
+ type_ = -1;
for (size_t i = 0; i != types.size(); ++i) {
string const & type_str = types[i];
type_list.append(toqstr(getGuiName(type_str)));