commit 156cfe595177f48aa4444fe799de6833da16ccce
Author: Richard Heck <rgh...@lyx.org>
Date:   Thu Feb 22 00:55:10 2018 -0500

    Fix bugs #10897 and #10912.
---
 src/CutAndPaste.cpp          |   12 ++++++------
 src/insets/InsetCitation.cpp |   16 ++++++++--------
 src/insets/InsetCitation.h   |    4 ----
 src/insets/InsetFloatList.h  |    3 ---
 status.23x                   |    2 ++
 5 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index d078cb9..f48eb45 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -808,11 +808,11 @@ void switchBetweenClasses(DocumentClassConstPtr oldone,
 
        // character styles and hidden table cells
        InsetIterator const i_end = inset_iterator_end(in);
-       for (InsetIterator it = inset_iterator_begin(in); it != i_end; ++it) {
-               InsetCode const code = it->lyxCode();
+       for (InsetIterator iit = inset_iterator_begin(in); iit != i_end; ++iit) 
{
+               InsetCode const code = iit->lyxCode();
                if (code == FLEX_CODE) {
                        // FIXME: Should we verify all InsetCollapsible?
-                       docstring const layoutName = it->layoutName();
+                       docstring const layoutName = iit->layoutName();
                        docstring const & n = 
newone->insetLayout(layoutName).name();
                        bool const is_undefined = n.empty() ||
                                n == DocumentClass::plainInsetLayout().name();
@@ -833,14 +833,14 @@ void switchBetweenClasses(DocumentClassConstPtr oldone,
                        // To warn the user that something had to be done.
                        errorlist.push_back(ErrorItem(
                                                      _("Undefined flex 
inset"), s,
-                                                     {it.paragraph().id(), 
it.pos()},
-                                                     {it.paragraph().id(), 
it.pos()+1}));
+                                                     {iit.paragraph().id(), 
iit.pos()},
+                                                     {iit.paragraph().id(), 
iit.pos() + 1}));
                } else if (code == TABULAR_CODE) {
                        // The recursion above does not catch paragraphs in 
"hidden" cells,
                        // i.e., ones that are part of a multirow or 
multicolum. So we need
                        // to handle those separately.
                        // This is the cause of bug #9049.
-                       InsetTabular * table = it->asInsetTabular();
+                       InsetTabular * table = iit->asInsetTabular();
                        table->setLayoutForHiddenCells(newtc);
                }
        }
diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp
index 11b8943..3201e83 100644
--- a/src/insets/InsetCitation.cpp
+++ b/src/insets/InsetCitation.cpp
@@ -42,9 +42,6 @@ using namespace lyx::support;
 
 namespace lyx {
 
-ParamInfo InsetCitation::param_info_;
-
-
 InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
        : InsetCommand(buf, p)
 {
@@ -64,6 +61,8 @@ InsetCitation::~InsetCitation()
 
 ParamInfo const & InsetCitation::findInfo(string const & /* cmdName */)
 {
+       static ParamInfo param_info_;
+
        // standard cite does only take one argument, but biblatex, jurabib
        // and natbib extend this to two arguments, so
        // we have to allow both here. InsetCitation takes care that
@@ -580,10 +579,11 @@ void InsetCitation::latex(otexstream & os, OutputParams 
const & runparams) const
        if (qualified)
                os << "s";
 
+       ParamInfo const & pinfo = findInfo(string());
        docstring before = params().prepareCommand(runparams, 
getParam("before"),
-                                                  
param_info_["before"].handling());
+                                                  pinfo["before"].handling());
        docstring after = params().prepareCommand(runparams, getParam("after"),
-                                                  
param_info_["after"].handling());
+                                                  pinfo["after"].handling());
        if (!before.empty() && cs.textBefore) {
                if (qualified)
                        os << '(' << protectArgument(before, '(', ')')
@@ -607,9 +607,9 @@ void InsetCitation::latex(otexstream & os, OutputParams 
const & runparams) const
                        map<docstring, docstring> posts = 
getQualifiedLists(getParam("posttextlist"));
                        for (docstring const & k: keys) {
                                docstring bef = 
params().prepareCommand(runparams, pres[k],
-                                                                       
param_info_["pretextlist"].handling());
-                               docstring aft  = 
params().prepareCommand(runparams, posts[k],
-                                                                        
param_info_["posttextlist"].handling());
+                                                  
pinfo["pretextlist"].handling());
+                               docstring aft = 
params().prepareCommand(runparams, posts[k],
+                                                  
pinfo["posttextlist"].handling());
                                if (!bef.empty())
                                        os << '[' << protectArgument(bef)
                                           << "][" << protectArgument(aft) << 
']';
diff --git a/src/insets/InsetCitation.h b/src/insets/InsetCitation.h
index 992a85e..0f914ec 100644
--- a/src/insets/InsetCitation.h
+++ b/src/insets/InsetCitation.h
@@ -107,10 +107,6 @@ private:
        docstring screenLabel() const;
        //@}
 
-       /// we'll eventually want to be able to get info on this from the
-       /// various CiteEngines
-       static ParamInfo param_info_;
-
        ///
        struct Cache {
                Cache() : recalculate(true) {}
diff --git a/src/insets/InsetFloatList.h b/src/insets/InsetFloatList.h
index 32a0dd5..3d6a7a3 100644
--- a/src/insets/InsetFloatList.h
+++ b/src/insets/InsetFloatList.h
@@ -78,9 +78,6 @@ private:
        ///
        docstring screenLabel() const;
        //@}
-
-       ///
-       static ParamInfo param_info_;
 };
 
 
diff --git a/status.23x b/status.23x
index ef9bf91..5820aca 100644
--- a/status.23x
+++ b/status.23x
@@ -116,3 +116,5 @@ What's new
 - Add support for automake 1.16.
 
 - Fix build of lyxconvert (used on Mac) with Qt4 (bug 11094).
+
+- Fix some compiler warnings.

Reply via email to