]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCitation.cpp
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / InsetCitation.cpp
index 5a007cf46f666a36ca1c8d6052ddb8798cefce0e..0f0f1bb78967490f6cedb037d0a5499859d24fcf 100644 (file)
@@ -20,8 +20,6 @@
 #include "FuncRequest.h"
 #include "LaTeXFeatures.h"
 
-#include "frontends/controllers/frontend_helpers.h"
-
 #include "support/fs_extras.h"
 #include "support/lstrings.h"
 
@@ -33,8 +31,6 @@
 
 namespace lyx {
 
-using support::ascii_lowercase;
-using support::contains;
 using support::FileName;
 using support::getStringFromVector;
 using support::getVectorFromString;
@@ -45,11 +41,8 @@ using support::split;
 using support::tokenPos;
 
 using std::endl;
-using std::replace;
 using std::string;
-using std::ostream;
 using std::vector;
-using std::map;
 
 namespace fs = boost::filesystem;
 
@@ -58,7 +51,7 @@ namespace {
 
 vector<string> const init_possible_cite_commands()
 {
-       char const * const pos[] = {
+       char const * const possible[] = {
                "cite", "citet", "citep", "citealt", "citealp",
                "citeauthor", "citeyear", "citeyearpar",
                "citet*", "citep*", "citealt*", "citealp*", "citeauthor*",
@@ -69,16 +62,16 @@ vector<string> const init_possible_cite_commands()
                "footcitealp", "footciteauthor", "footciteyear", "footciteyearpar",
                "citefield", "citetitle", "cite*"
        };
-       size_t const size_pos = sizeof(pos) / sizeof(pos[0]);
+       size_t const size_possible = sizeof(possible) / sizeof(possible[0]);
 
-       return vector<string>(pos, pos + size_pos);
+       return vector<string>(possible, possible + size_possible);
 }
 
 
 vector<string> const & possible_cite_commands()
 {
-       static vector<string> const pos = init_possible_cite_commands();
-       return pos;
+       static vector<string> const possible = init_possible_cite_commands();
+       return possible;
 }
 
 
@@ -135,20 +128,20 @@ string const
                                output = input;
                        break;
 
-                       case biblio::ENGINE_JURABIB: {
-               // Jurabib does not support the 'uppercase' natbib style.
-                               if (input[0] == 'C')
-                                       output = string(1, 'c') + input.substr(1);
-                               else
-                                       output = input;
+               case biblio::ENGINE_JURABIB: {
+                       // Jurabib does not support the 'uppercase' natbib style.
+                       if (input[0] == 'C')
+                               output = string(1, 'c') + input.substr(1);
+                       else
+                               output = input;
 
-               // Jurabib does not support the 'full' natbib style.
-                               string::size_type const n = output.size() - 1;
-                               if (output != "cite*" && output[n] == '*')
-                                       output = output.substr(0, n);
+                       // Jurabib does not support the 'full' natbib style.
+                       string::size_type const n = output.size() - 1;
+                       if (output != "cite*" && output[n] == '*')
+                               output = output.substr(0, n);
 
-                               break;
-                       }
+                       break;
+               }
        }
 
        return output;
@@ -371,6 +364,8 @@ docstring const getNatbibLabel(Buffer const & buffer,
 
 docstring const getBasicLabel(docstring const & keyList, docstring const & after)
 {
+       using support::contains;
+
        docstring keys(keyList);
        docstring label;
 
@@ -462,9 +457,7 @@ int InsetCitation::plaintext(Buffer const & buffer, odocstream & os,
 }
 
 
-namespace {
-
-docstring const cleanupWhitespace(docstring const & citelist)
+static docstring const cleanupWhitespace(docstring const & citelist)
 {
        docstring::const_iterator it  = citelist.begin();
        docstring::const_iterator end = citelist.end();
@@ -481,8 +474,6 @@ docstring const cleanupWhitespace(docstring const & citelist)
        return result;
 }
 
-// end anon namyspace
-}
 
 int InsetCitation::docbook(Buffer const &, odocstream & os,
                           OutputParams const &) const
@@ -548,7 +539,7 @@ void InsetCitation::replaceContents(string const & from, string const & to)
 {
        if (tokenPos(getContents(), ',', from) != -1) {
                vector<string> items = getVectorFromString(getContents());
-               replace(items.begin(), items.end(), from, to);
+               std::replace(items.begin(), items.end(), from, to);
                setContents(getStringFromVector(items));
        }
 }