From e0f553b941ef2a14da046e1f4e10acbf3d63b08d Mon Sep 17 00:00:00 2001 From: Yuriy Skalko Date: Wed, 2 Dec 2020 00:16:55 +0200 Subject: [PATCH] Fix warnings and use range-based loop --- src/frontends/qt/Menus.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/frontends/qt/Menus.cpp b/src/frontends/qt/Menus.cpp index 8437ace210..e567c64f36 100644 --- a/src/frontends/qt/Menus.cpp +++ b/src/frontends/qt/Menus.cpp @@ -1809,12 +1809,8 @@ void MenuDefinition::expandQuotes(BufferView const * bv) InsetQuotes const * qinset = static_cast(inset); - map styles = quoteparams.getTypes(); string const qtype = qinset->getType(); - map::const_iterator qq = styles.begin(); - map::const_iterator end = styles.end(); - MenuDefinition aqs; BufferParams const & bp = bv->buffer().masterBuffer()->params(); @@ -1856,10 +1852,12 @@ void MenuDefinition::expandQuotes(BufferView const * bv) main_dynamic_qs = true; } // now traverse through the static styles ... - for (; qq != end; ++qq) { - docstring const style = from_ascii(qq->first); - bool langdef = (style[0] == langqs); - bool globaldef = (style[0] == globalqsc); + map styles = quoteparams.getTypes(); + for (auto const & s : styles) { + char style_char = (s.first)[0]; + bool langdef = (style_char == langqs); + bool globaldef = (style_char == globalqsc); + docstring const style = from_ascii(s.first); if (prefixIs(style, qtype[0])) { FuncRequest cmd = FuncRequest(LFUN_INSET_MODIFY, subcmd + style);