From: Abdelrazak Younes Date: Mon, 2 Jun 2008 13:59:00 +0000 (+0000) Subject: Fix http://bugzilla.lyx.org/show_bug.cgi?id=4904 X-Git-Tag: 1.6.10~4559 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2003a50e14052e230dcf40dcc4a45742033366ef;p=lyx.git Fix http://bugzilla.lyx.org/show_bug.cgi?id=4904 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25070 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/TocModel.cpp b/src/frontends/qt4/TocModel.cpp index ce23f24dc4..37254dc9a0 100644 --- a/src/frontends/qt4/TocModel.cpp +++ b/src/frontends/qt4/TocModel.cpp @@ -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