]> git.lyx.org Git - lyx.git/blobdiff - src/ToolbarBackend.C
fix bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section...
[lyx.git] / src / ToolbarBackend.C
index 01cad0b86b886240f6ae501aa18297975547540f..baa2ddfbcdfaf57865410b8aaaf1f53a02978fb4 100644 (file)
@@ -30,7 +30,7 @@ using lyx::support::subst;
 
 using std::endl;
 using std::make_pair;
-
+using std::string;
 using std::vector;
 
 
@@ -75,6 +75,13 @@ void ToolbarBackend::read(LyXLex & lex)
 
        Toolbar tb;
        tb.name = lex.getString();
+       lex.next(true);
+       if (!lex.isOK()) {
+               lyxerr << "ToolbarBackend::read: Malformed toolbar "
+                       "description " <<  lex.getString() << endl;
+               return;
+       }
+       tb.gui_name = lex.getString();
 
        bool quit = false;
 
@@ -200,11 +207,14 @@ void ToolbarBackend::add(Toolbar & tb,
                         FuncRequest const & func, string const & tooltip)
 {
        tb.items.push_back(make_pair(func, tooltip));
+       tb.items.back().first.origin = FuncRequest::UI;
 }
 
 
 string const ToolbarBackend::getIcon(FuncRequest const & f)
 {
+       using lyx::frontend::find_xpm;
+
        string fullname;
 
        if (f.action == LFUN_INSERT_MATH) {