#include "InsetCitation.h"
-#include "Biblio.h"
#include "Buffer.h"
#include "BufferParams.h"
#include "debug.h"
#include "FuncRequest.h"
#include "LaTeXFeatures.h"
-#include "frontends/controllers/frontend_helpers.h"
-
#include "support/fs_extras.h"
#include "support/lstrings.h"
namespace lyx {
-using support::ascii_lowercase;
-using support::contains;
using support::FileName;
using support::getStringFromVector;
using support::getVectorFromString;
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;
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*",
"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;
}
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;
docstring const getBasicLabel(docstring const & keyList, docstring const & after)
{
+ using support::contains;
+
docstring keys(keyList);
docstring label;
}
-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();
return result;
}
-// end anon namyspace
-}
int InsetCitation::docbook(Buffer const &, odocstream & os,
OutputParams const &) const
{
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));
}
}