From: Juergen Spitzmueller Date: Sun, 6 Apr 2014 17:21:47 +0000 (+0200) Subject: Fix iterator invalidation. X-Git-Tag: 2.1.0~69 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=21f62c7184859eb8aadcf8c6efba2f3cdd810da4;p=lyx.git Fix iterator invalidation. --- diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp index 6f1a02fdc1..d579132a21 100644 --- a/src/insets/InsetLayout.cpp +++ b/src/insets/InsetLayout.cpp @@ -596,8 +596,9 @@ Layout::LaTeXArgMap InsetLayout::args() const unsigned int InsetLayout::optArgs() const { unsigned int nr = 0; - Layout::LaTeXArgMap::const_iterator it = args().begin(); - for (; it != args().end(); ++it) { + Layout::LaTeXArgMap const args = InsetLayout::args(); + Layout::LaTeXArgMap::const_iterator it = args.begin(); + for (; it != args.end(); ++it) { if (!(*it).second.mandatory) ++nr; } @@ -608,8 +609,9 @@ unsigned int InsetLayout::optArgs() const unsigned int InsetLayout::requiredArgs() const { unsigned int nr = 0; - Layout::LaTeXArgMap::const_iterator it = args().begin(); - for (; it != args().end(); ++it) { + Layout::LaTeXArgMap const args = InsetLayout::args(); + Layout::LaTeXArgMap::const_iterator it = args.begin(); + for (; it != args.end(); ++it) { if ((*it).second.mandatory) ++nr; }