commit 21f62c7184859eb8aadcf8c6efba2f3cdd810da4
Author: Juergen Spitzmueller <[email protected]>
Date: Sun Apr 6 19:21:47 2014 +0200
Fix iterator invalidation.
diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp
index 6f1a02f..d579132 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;
}