X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FQLToolbar.cpp;h=f1bab092b5e17a111662d61b40ac6ef5140dd1af;hb=39cf8bcf168fbce3a7f1fe95efe4cb256342ce78;hp=8186c7b6efb2242f1df4c1a6ad06b2309217ff03;hpb=1f2f2892c43454d36aa021afbe0a42afdd21ac83;p=features.git diff --git a/src/frontends/qt4/QLToolbar.cpp b/src/frontends/qt4/QLToolbar.cpp index 8186c7b6ef..f1bab092b5 100644 --- a/src/frontends/qt4/QLToolbar.cpp +++ b/src/frontends/qt4/QLToolbar.cpp @@ -214,9 +214,13 @@ void QLToolbar::add(ToolbarItem const & item) IconPalette * panel = new IconPalette(tb); panel->setWindowTitle(qt_(to_ascii(item.label_))); connect(this, SIGNAL(updated()), panel, SLOT(updateParent())); - ToolbarInfo const & tbinfo = toolbarbackend.getToolbar(item.name_); - ToolbarInfo::item_iterator it = tbinfo.items.begin(); - ToolbarInfo::item_iterator const end = tbinfo.items.end(); + ToolbarInfo const * tbinfo = toolbarbackend.getDefinedToolbarInfo(item.name_); + if (!tbinfo) { + lyxerr << "Unknown toolbar " << item.name_ << endl; + break; + } + ToolbarInfo::item_iterator it = tbinfo->items.begin(); + ToolbarInfo::item_iterator const end = tbinfo->items.end(); for (; it != end; ++it) if (!getStatus(it->func_).unknown()) { Action * action = new Action(owner_, @@ -227,7 +231,7 @@ void QLToolbar::add(ToolbarItem const & item) panel->addButton(action); ActionVector.push_back(action); // use the icon of first action for the toolbar button - if (it == tbinfo.items.begin()) + if (it == tbinfo->items.begin()) tb->setIcon(QPixmap(getIcon(it->func_).c_str())); } tb->setCheckable(true); @@ -251,9 +255,13 @@ void QLToolbar::add(ToolbarItem const & item) m->setWindowTitle(qt_(to_ascii(item.label_))); m->setTearOffEnabled(true); connect(this, SIGNAL(updated()), m, SLOT(updateParent())); - ToolbarInfo const & tbinfo = toolbarbackend.getToolbar(item.name_); - ToolbarInfo::item_iterator it = tbinfo.items.begin(); - ToolbarInfo::item_iterator const end = tbinfo.items.end(); + ToolbarInfo const * tbinfo = toolbarbackend.getDefinedToolbarInfo(item.name_); + if (!tbinfo) { + lyxerr << "Unknown toolbar " << item.name_ << endl; + break; + } + ToolbarInfo::item_iterator it = tbinfo->items.begin(); + ToolbarInfo::item_iterator const end = tbinfo->items.end(); for (; it != end; ++it) if (!getStatus(it->func_).unknown()) { Action * action = new Action(owner_,