]> git.lyx.org Git - lyx.git/commitdiff
Fix http://bugzilla.lyx.org/show_bug.cgi?id=4904
authorAbdelrazak Younes <younes@lyx.org>
Mon, 2 Jun 2008 13:59:00 +0000 (13:59 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 2 Jun 2008 13:59:00 +0000 (13:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25070 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/TocModel.cpp

index ce23f24dc42489d9b791c50a5dbdfdef0a4a4d0a..37254dc9a0ef49568ebbe086552ff824ccc534f8 100644 (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