]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/Toolbar_pimpl.C
Swap two printer related help messages.
[lyx.git] / src / frontends / xforms / Toolbar_pimpl.C
index 62c362d948cab3af0fa2bdf0564bc0ca9431259b..db5c7d0a0bccfaca4698faf8f670ea4c3d3d224d 100644 (file)
@@ -63,7 +63,7 @@ void Toolbar::Pimpl::toolbarItem::clean() {
 
 
 Toolbar::Pimpl::toolbarItem & 
-Toolbar::Pimpl::toolbarItem::operator=(const toolbarItem & ti) {
+Toolbar::Pimpl::toolbarItem::operator=(toolbarItem const & ti) {
        // Are we assigning the object onto itself?
        if (this == &ti)
                return *this;
@@ -120,13 +120,13 @@ int BubblePost(FL_OBJECT *ob, int event,
        FL_OBJECT * bubble_timer = reinterpret_cast<FL_OBJECT *>(ob->u_cdata);
        
        // We do not test for empty help here, since this can never happen
-       if(event == FL_ENTER){
+       if (event == FL_ENTER){
                fl_set_object_callback(bubble_timer,
                                       C_Toolbar_BubbleTimerCB,
                                       reinterpret_cast<long>(ob));
                fl_set_timer(bubble_timer, 1);
        }
-       else if(event != FL_MOTION){
+       else if (event != FL_MOTION){
                fl_set_timer(bubble_timer, 0);
                fl_hide_oneliner();
        }
@@ -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,19 +238,21 @@ void Toolbar::Pimpl::clearLayoutList()
        }
 }
 
+
 void Toolbar::Pimpl::openLayoutList()
 {
        if (combox)
                combox->Show();
 }
 
+
 static
 void ToolbarCB(FL_OBJECT * ob, long ac)
 {
        LyXView * owner = static_cast<LyXView *>(ob->u_vdata);
        
        string res = owner->getLyXFunc()->Dispatch(int(ac));
-       if(!res.empty())
+       if (!res.empty())
                lyxerr[Debug::GUI] << "ToolbarCB: Function returned: " 
                                   << res << endl;
 }
@@ -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;
@@ -341,7 +349,7 @@ void Toolbar::Pimpl::set(bool doingmain)
        ToolbarList::iterator item = toollist.begin();
        ToolbarList::iterator end = toollist.end();
        for (; item != end; ++item) {
-               switch(item->action){
+               switch (item->action){
                case ToolbarDefaults::SEPARATOR:
                        xpos += sepspace;
                        break;