]> git.lyx.org Git - lyx.git/commitdiff
Fix iterator invalidation.
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 6 Apr 2014 17:21:47 +0000 (19:21 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 6 Apr 2014 17:21:47 +0000 (19:21 +0200)
src/insets/InsetLayout.cpp

index 6f1a02fdc1d0894f78843190f020a6994c14e5b7..d579132a2129d5f2d3839461b830eff23f8414f9 100644 (file)
@@ -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;
        }