reading the patch....
// we have to provide all the optional arguments here, even though
// the last one is the only one we care about.
// Separate handling of optional argument inset.
- if (layout_->latexargs().size() != 0)
+ if (!layout_->latexargs().empty())
latexArgInsets(*owner_, os, features.runparams(),
layout_->latexargs());
else
if (lait != args.end()) {
enable = true;
InsetList::const_iterator it = cur.paragraph().insetList().begin();
- InsetList::const_iterator end = cur.paragraph().insetList().end();
+ InsetList::const_iterator const end = cur.paragraph().insetList().end();
for (; it != end; ++it) {
if (it->inset->lyxCode() == ARG_CODE) {
InsetArgument const * ins =
// Handle pre 2.1 ArgInsets (lyx2lyx cannot classify them)
if (name_ == "999") {
- int req = insetlayout ? it.inset().getLayout().requiredArgs()
+ unsigned int const req = insetlayout ? it.inset().getLayout().numRequiredArgs()
: it.paragraph().layout().requiredArgs();
- int opts = insetlayout ? it.inset().getLayout().optArgs()
+ unsigned int const opts = insetlayout ? it.inset().getLayout().numOptArgs()
: it.paragraph().layout().optArgs();
- int nr = 0;
- int ours = 0;
+ unsigned int nr = 0;
+ unsigned int ours = 0;
InsetList::const_iterator parit = it.paragraph().insetList().begin();
InsetList::const_iterator parend = it.paragraph().insetList().end();
for (; parit != parend; ++parit) {
}
}
bool done = false;
- int realopts = 0;
+ unsigned int realopts = 0;
if (nr > req) {
// We have optional arguments
realopts = nr - req;
latexargs_[nr] = arg;
}
-int InsetLayout::optArgs() const
+unsigned int InsetLayout::numOptArgs() const
{
- int nr = 0;
+ unsigned int nr = 0;
Layout::LaTeXArgMap::const_iterator it = latexargs_.begin();
for (; it != latexargs_.end(); ++it) {
if (!(*it).second.mandatory)
}
-int InsetLayout::requiredArgs() const
+unsigned int InsetLayout::numRequiredArgs() const
{
- int nr = 0;
+ unsigned int nr = 0;
Layout::LaTeXArgMap::const_iterator it = latexargs_.begin();
for (; it != latexargs_.end(); ++it) {
if ((*it).second.mandatory)
///
Layout::LaTeXArgMap latexargs() const { return latexargs_; }
///
- int optArgs() const;
+ unsigned int numOptArgs() const;
///
- int requiredArgs() const;
+ unsigned int numRequiredArgs() const;
///
docstring preamble() const { return preamble_; }
/// Get language dependent macro definitions needed for this inset
if (style.isEnvironment()) {
os << "\\begin{" << from_ascii(style.latexname()) << '}';
- if (style.latexargs().size() != 0)
+ if (!style.latexargs().empty())
latexArgInsets(*pit, os, runparams, style.latexargs());
if (style.latextype == LATEX_LIST_ENVIRONMENT) {
os << '{'
void latexArgInsets(Paragraph const & par, otexstream & os,
- OutputParams const & runparams, Layout::LaTeXArgMap latexargs)
+ OutputParams const & runparams, Layout::LaTeXArgMap const & latexargs)
{
map<int, InsetArgument const *> ilist;
vector<string> required;
Layout::LaTeXArgMap::const_iterator const lit =
latexargs.find(nr);
if (lit != latexargs.end()) {
- Layout::latexarg arg = (*lit).second;
+ Layout::latexarg const & arg = (*lit).second;
if (!arg.requires.empty()) {
vector<string> req = getVectorFromString(arg.requires);
required.insert(required.end(), req.begin(), req.end());
os << '\\' << from_ascii(style.latexname());
// Separate handling of optional argument inset.
- if (style.latexargs().size() != 0)
+ if (!style.latexargs().empty())
latexArgInsets(par, os, runparams, style.latexargs());
else
os << from_ascii(style.latexparam());
/// must all come first.
void latexArgInsets(Paragraph const & par,
otexstream & os, OutputParams const & runparams,
- Layout::LaTeXArgMap latexargs);
+ Layout::LaTeXArgMap const & latexargs);
/** Export \p paragraphs of buffer \p buf to LaTeX.
Don't use a temporary stringstream for \p os if the final output is