git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25070 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-06-02 13:59:00 +00:00
parent cebd63f844
commit 2003a50e14

View File

@ -273,7 +273,12 @@ int TocModels::decodeType(QString const & str) const
// Default to Outliner.
new_type = "tableofcontents";
}
return types_.indexOf(new_type);
int const type = types_.indexOf(new_type);
if (type != -1)
return type;
// If everything else fails, settle on the table of contents which is
// guaranted to exist.
return types_.indexOf("tableofcontents");
}
} // namespace frontend