]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/Toolbar_pimpl.C
More pref work from Angus
[lyx.git] / src / frontends / xforms / Toolbar_pimpl.C
index 788135c251730508820bd62c3b2f844348b28462..d9a72639bc422e168f13dd0d38e86cebf8fed3d8 100644 (file)
@@ -220,15 +220,16 @@ void Toolbar::Pimpl::updateLayoutList(bool force)
                for (LyXTextClass::const_iterator cit = tc.begin();
                     cit != end; ++cit) {
                        if ((*cit).obsoleted_by().empty())
-                               combox->addline(_((*cit).name().c_str()));
+                               combox->addline(_((*cit).name()));
                        else
-                               combox->addline(("@N" + string(_((*cit).name().c_str()))).c_str());
+                               combox->addline("@N" + _((*cit).name()));
                }
        }
        // we need to do this.
        combox->Redraw();
 }
 
+
 void Toolbar::Pimpl::clearLayoutList()
 {
        if (combox) {
@@ -237,12 +238,14 @@ void Toolbar::Pimpl::clearLayoutList()
        }
 }
 
+
 void Toolbar::Pimpl::openLayoutList()
 {
        if (combox)
                combox->Show();
 }
 
+
 static
 void ToolbarCB(FL_OBJECT * ob, long ac)
 {
@@ -260,11 +263,12 @@ extern "C" void C_Toolbar_ToolbarCB(FL_OBJECT * ob, long data)
        ToolbarCB(ob, data);
 }
 
+
 #if 0
 // What are we supposed to do with that??
 int Toolbar::get_toolbar_func(string const & func)
 {
-       int action = lyxaction.LookupFunc(func.c_str());
+       int action = lyxaction.LookupFunc(func);
        if (action == -1) {
                if (func == "separator"){
                        action = TOOL_SEPARATOR;
@@ -302,12 +306,16 @@ void setPixmap(FL_OBJECT * obj, int action, int buttonwidth, int height) {
        }
 
        if (act == LFUN_INSERT_MATH && !arg.empty()) {
-               lyxerr[Debug::GUI] << "Using mathed-provided icon" << endl;
                char const ** pixmap = get_pixmap_from_symbol(arg.c_str(),
                                                        buttonwidth,
                                                        height);
-               fl_set_pixmapbutton_data(obj, const_cast<char **>(pixmap));
-               return;
+               if (pixmap) {
+                       lyxerr[Debug::GUI] << "Using mathed-provided icon"
+                                          << endl;
+                       fl_set_pixmapbutton_data(obj,
+                                                const_cast<char **>(pixmap));
+                       return;
+               }
        }
        
        lyxerr << "Unable to find icon `" << xpm_name << "'" << endl;