mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
GuiToc::initialiseParams(): Fix list type parsing
TocWidget::updateGui(): Fix for non existent list. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22957 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6820d18e11
commit
3256dbc78a
@ -140,14 +140,15 @@ TocList const & GuiToc::tocs() const
|
||||
bool GuiToc::initialiseParams(string const & data)
|
||||
{
|
||||
LYXERR(Debug::GUI, data);
|
||||
LYXERR0(data);
|
||||
QString str = QString::fromUtf8(data.c_str());
|
||||
string new_type = "tableofcontents";
|
||||
if (str.contains("floatlist")) {
|
||||
if (str.contains("figure"))
|
||||
if (str.contains("\"figure"))
|
||||
new_type = "figure";
|
||||
else if (str.contains("table"))
|
||||
else if (str.contains("\"table"))
|
||||
new_type = "table";
|
||||
else if (str.contains("algorithm"))
|
||||
else if (str.contains("\"algorithm"))
|
||||
new_type = "algorithm";
|
||||
}
|
||||
|
||||
@ -170,7 +171,6 @@ bool GuiToc::initialiseParams(string const & data)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
widget_->updateGui(selected_type);
|
||||
|
||||
return true;
|
||||
|
@ -228,7 +228,8 @@ void TocWidget::updateGui(int selected_type)
|
||||
QString item = toqstr(type_names[i]);
|
||||
typeCO->addItem(item);
|
||||
}
|
||||
typeCO->setCurrentIndex(selected_type);
|
||||
if (selected_type != -1)
|
||||
typeCO->setCurrentIndex(selected_type);
|
||||
typeCO->blockSignals(false);
|
||||
|
||||
setTocModel(typeCO->currentIndex());
|
||||
|
Loading…
Reference in New Issue
Block a user