]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/TocModel.cpp
fix completion painting for RTL (inline completion and completion list)
[lyx.git] / 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