- Polish the behavior when the TOC is empty (clearing the button and the TOC tree)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15373
a592a061-630c-0410-9148-
cb99ea01b6c8
<< " toc_models_.size() " << toc_models_.size()
<< endl;
<< " toc_models_.size() " << toc_models_.size()
<< endl;
+ if (toc_models_.empty())
+ return 0;
+
BOOST_ASSERT(type_ >= 0 && type_ < int(toc_models_.size()));
return toc_models_[type_];
}
BOOST_ASSERT(type_ >= 0 && type_ < int(toc_models_.size()));
return toc_models_[type_];
}
type_ = 0;
vector<string> const & types = getTypes();
type_ = 0;
vector<string> const & types = getTypes();
+ if (types.empty()) {
+ type_model_.setStringList(type_list);
+ toc_models_.clear();
string const & selected_type = toc::getType(params().getCmdName());
lyxerr[Debug::GUI] << "selected_type " << selected_type << endl;
string const & selected_type = toc::getType(params().getCmdName());
lyxerr[Debug::GUI] << "selected_type " << selected_type << endl;
if (type_model->stringList().isEmpty())
{
enableButtons();
if (type_model->stringList().isEmpty())
{
enableButtons();
+ typeCO->setModel(type_model);
+ tocTV->setModel(new QStandardItemModel);