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:
Abdelrazak Younes 2008-02-12 09:32:40 +00:00
parent 6820d18e11
commit 3256dbc78a
2 changed files with 6 additions and 5 deletions

View File

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

View File

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