From 6936c1b4fa7f4a9e0ec98046431217b6916fed58 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 14 Dec 2017 13:39:37 +0100 Subject: [PATCH] Fix MSVC warning Take this occasion to simplify the code. Fixes bug #10402. --- src/insets/InsetInfo.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index 700049d6ee..0740fb4c91 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -408,12 +408,9 @@ void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype) { Font const f(inherit_font, buffer().params().language); //Font fu = f; //fu.fontInfo().setUnderbar(FONT_ON); - docstring_list::const_iterator beg = names.begin(); - docstring_list::const_iterator end = names.end(); - for (docstring_list::const_iterator it = beg ; - it != end ; ++it) { + for (docstring const & name : names) { // do not insert > for the top level menu item - if (it != beg) + if (&name != &names.front()) par.insertInset(par.size(), new InsetSpecialChar(InsetSpecialChar::MENU_SEPARATOR), f, Change(Change::UNCHANGED)); //FIXME: add proper underlines here. This @@ -421,9 +418,8 @@ void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype) { // return a vector of menus. If we do not do // that, we might as well use below // Paragraph::insert on each string (JMarc) - for (size_type i = 0; i != it->length(); ++i) - par.insertChar(par.size(), (*it)[i], - f, Change(Change::UNCHANGED)); + for (char_type c : name) + par.insertChar(par.size(), c, f, Change(Change::UNCHANGED)); } break; } -- 2.39.2