The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 1252c22fd35424f817e8ca216a57f509cc5526d6
Author: Richard Heck <[email protected]>
Date:   Fri Nov 23 20:40:38 2012 -0500

    Some minor cleanup of new InsetArguments stuff that I did while
    reading the patch....

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 8429b01..ee80b94 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1461,7 +1461,7 @@ void Paragraph::Private::validate(LaTeXFeatures & 
features) const
                        // 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
diff --git a/src/Text3.cpp b/src/Text3.cpp
index 7a72696..9cace0d 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -2531,7 +2531,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & 
cmd,
                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 =
diff --git a/src/insets/InsetArgument.cpp b/src/insets/InsetArgument.cpp
index 91ae4aa..80b69e0 100644
--- a/src/insets/InsetArgument.cpp
+++ b/src/insets/InsetArgument.cpp
@@ -59,12 +59,12 @@ void InsetArgument::updateBuffer(ParIterator const & it, 
UpdateType utype)
 
        // 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) {
@@ -75,7 +75,7 @@ void InsetArgument::updateBuffer(ParIterator const & it, 
UpdateType utype)
                        }
                }
                bool done = false;
-               int realopts = 0;
+               unsigned int realopts = 0;
                if (nr > req) {
                        // We have optional arguments
                        realopts = nr - req;
diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp
index 87be22c..53f56ae 100644
--- a/src/insets/InsetLayout.cpp
+++ b/src/insets/InsetLayout.cpp
@@ -525,9 +525,9 @@ void InsetLayout::readArgument(Lexer & lex)
                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)
@@ -537,9 +537,9 @@ int InsetLayout::optArgs() const
 }
 
 
-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)
diff --git a/src/insets/InsetLayout.h b/src/insets/InsetLayout.h
index 33fcffa..3ddee16 100644
--- a/src/insets/InsetLayout.h
+++ b/src/insets/InsetLayout.h
@@ -84,9 +84,9 @@ public:
        ///
        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
diff --git a/src/output_latex.cpp b/src/output_latex.cpp
index 2112b80..e680cc7 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -162,7 +162,7 @@ static TeXEnvironmentData prepareEnvironment(Buffer const & 
buf,
 
        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 << '{'
@@ -313,7 +313,7 @@ void TeXEnvironment(Buffer const & buf, Text const & text,
 
 
 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;
@@ -332,7 +332,7 @@ void latexArgInsets(Paragraph const & par, otexstream & os,
                                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());
@@ -407,7 +407,7 @@ void parStartCommand(Paragraph const & par, otexstream & os,
                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());
diff --git a/src/output_latex.h b/src/output_latex.h
index ee0419b..fa07ca6 100644
--- a/src/output_latex.h
+++ b/src/output_latex.h
@@ -38,7 +38,7 @@ class Text;
 /// 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

-----------------------------------------------------------------------

Summary of changes:
 src/Paragraph.cpp            |    2 +-
 src/Text3.cpp                |    2 +-
 src/insets/InsetArgument.cpp |   10 +++++-----
 src/insets/InsetLayout.cpp   |    8 ++++----
 src/insets/InsetLayout.h     |    4 ++--
 src/output_latex.cpp         |    8 ++++----
 src/output_latex.h           |    2 +-
 7 files changed, 18 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to