+namespace {
+
+void addArgInsets(Paragraph const & par, string const & prefix,
+ Layout::LaTeXArgMap const & latexargs,
+ map<int, InsetArgument const *> & ilist,
+ vector<string> & required)
+{
+ for (auto const & table : par.insetList()) {
+ InsetArgument const * arg = table.inset->asInsetArgument();
+ if (!arg)
+ continue;
+ if (arg->name().empty()) {
+ LYXERR0("Error: Unnamed argument inset!");
+ continue;
+ }
+ string const name = prefix.empty() ?
+ arg->name() : split(arg->name(), ':');
+ // why converting into an integer?
+ unsigned int const nr = convert<unsigned int>(name);
+ if (ilist.find(nr) == ilist.end())
+ ilist[nr] = arg;
+ Layout::LaTeXArgMap::const_iterator const lit =
+ latexargs.find(arg->name());
+ if (lit != latexargs.end()) {
+ Layout::latexarg const & larg = lit->second;
+ vector<string> req = getVectorFromString(larg.requires);
+ move(req.begin(), req.end(), back_inserter(required));
+ }
+ }
+}
+
+} // anon namespace
+
+