Alert::warning(_("Branch already exists"), drtmp.message());
break;
}
- BranchList & branch_list = buffer_.params().branchlist();
- vector<docstring> const branches =
- getVectorFromString(branch_name, branch_list.separator());
- for (vector<docstring>::const_iterator it = branches.begin();
- it != branches.end(); ++it) {
- branch_name = *it;
- lyx::dispatch(FuncRequest(LFUN_BRANCH_INSERT, branch_name));
- }
+ docstring const sep = buffer_.params().branchlist().separator();
+ for (docstring const & branch : getVectorFromString(branch_name, sep))
+ lyx::dispatch(FuncRequest(LFUN_BRANCH_INSERT, branch));
break;
}
void BufferView::gotoLabel(docstring const & label)
{
- ListOfBuffers bufs = buffer().allRelatives();
- ListOfBuffers::iterator it = bufs.begin();
- for (; it != bufs.end(); ++it) {
- Buffer const * buf = *it;
-
+ for (Buffer const * buf : buffer().allRelatives()) {
// find label
- shared_ptr<Toc> toc = buf->tocBackend().toc("label");
- Toc::const_iterator toc_it = toc->begin();
- Toc::const_iterator end = toc->end();
- for (; toc_it != end; ++toc_it) {
- if (label == toc_it->str()) {
- lyx::dispatch(toc_it->action());
+ for (TocItem const & item : *buf->tocBackend().toc("label")) {
+ if (label == item.str()) {
+ lyx::dispatch(item.action());
return;
}
}