mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-30 05:12:40 +00:00
- Fix a crash when IN is clicked multiple time in a single line document.
- 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
This commit is contained in:
parent
8f426399d8
commit
f23082917e
@ -58,6 +58,9 @@ QStandardItemModel * QToc::tocModel()
|
|||||||
<< " toc_models_.size() " << toc_models_.size()
|
<< " toc_models_.size() " << toc_models_.size()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
|
if (toc_models_.empty())
|
||||||
|
return 0;
|
||||||
|
|
||||||
BOOST_ASSERT(type_ >= 0 && type_ < int(toc_models_.size()));
|
BOOST_ASSERT(type_ >= 0 && type_ < int(toc_models_.size()));
|
||||||
return toc_models_[type_];
|
return toc_models_[type_];
|
||||||
}
|
}
|
||||||
@ -118,8 +121,11 @@ void QToc::update()
|
|||||||
type_ = 0;
|
type_ = 0;
|
||||||
|
|
||||||
vector<string> const & types = getTypes();
|
vector<string> const & types = getTypes();
|
||||||
if (types.empty())
|
if (types.empty()) {
|
||||||
|
type_model_.setStringList(type_list);
|
||||||
|
toc_models_.clear();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
string const & selected_type = toc::getType(params().getCmdName());
|
string const & selected_type = toc::getType(params().getCmdName());
|
||||||
lyxerr[Debug::GUI] << "selected_type " << selected_type << endl;
|
lyxerr[Debug::GUI] << "selected_type " << selected_type << endl;
|
||||||
|
@ -190,6 +190,8 @@ void QTocDialog::updateGui()
|
|||||||
if (type_model->stringList().isEmpty())
|
if (type_model->stringList().isEmpty())
|
||||||
{
|
{
|
||||||
enableButtons();
|
enableButtons();
|
||||||
|
typeCO->setModel(type_model);
|
||||||
|
tocTV->setModel(new QStandardItemModel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user