commit 6936c1b4fa7f4a9e0ec98046431217b6916fed58
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Thu Dec 14 13:39:37 2017 +0100
Fix MSVC warning
Take this occasion to simplify the code.
Fixes bug #10402.
---
src/insets/InsetInfo.cpp | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp
index 700049d..0740fb4 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;
}