Jean-Marc Lasgouttes wrote:
rgheck <rgh...@bobjweil.com> writes:
+               case TC_INSETLAYOUT: {
                        if (lexrc.next()) {
[long stuff snipped]
+                       } else {
+                               lexrc.printError("No name given for InsetLayout: 
`$$Token'.");
+                               error = true;
                        }

I would do
  if (!lexrc.next()) {
        lexrc.printError("No name given for InsetLayout: `$$Token'.");
        error = true;
        break;
  }
in order to save one indentation level.

I thought about this, but decided to keep it the same as TC_STYLE. But that one ought to be like this, too. So I'll fix them both.
+bool TextClass::hasInsetLayout(docstring const & n) const
+{
+ if (n.empty()) + return false;
+       InsetLayouts::const_iterator it = insetlayoutlist_.begin();
+       InsetLayouts::const_iterator en = insetlayoutlist_.end();
+       for (; it != en; ++it)
+               if (n == it->first)
+                       return true;
+       return false;
+}
+
+

Can't you use std::map::find() directly (aka insetlayoutlist_.find(n))?

Yes, silly me. Also fixed.

Committed.

rh

Reply via email to