#include "boost/regex.hpp"
using namespace std;
+using namespace lyx::support;
namespace lyx {
-using support::bformat;
-using support::compare_no_case;
-using support::getVectorFromString;
-using support::ltrim;
-using support::rtrim;
//////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////
namespace {
-// A functor for use with std::sort, leading to case insensitive sorting
- class compareNoCase: public std::binary_function<docstring, docstring, bool>
+// A functor for use with sort, leading to case insensitive sorting
+ class compareNoCase: public binary_function<docstring, docstring, bool>
{
public:
bool operator()(docstring const & s1, docstring const & s2) const {
BiblioInfo::const_iterator it = begin();
for (; it != end(); ++it)
bibkeys.push_back(it->first);
- std::sort(bibkeys.begin(), bibkeys.end(), compareNoCase());
+ sort(bibkeys.begin(), bibkeys.end(), compareNoCase());
return bibkeys;
}
set<docstring>::const_iterator end = fieldNames.end();
for (; it != end; ++it)
bibfields.push_back(*it);
- std::sort(bibfields.begin(), bibfields.end());
+ sort(bibfields.begin(), bibfields.end());
return bibfields;
}
set<docstring>::const_iterator end = entryTypes.end();
for (; it != end; ++it)
bibentries.push_back(*it);
- std::sort(bibentries.begin(), bibentries.end());
+ sort(bibentries.begin(), bibentries.end());
return bibentries;
}
docstring const & key, Buffer const & buf) const
{
biblio::CiteEngine const engine = buf.params().getEngine();
- if (engine == biblio::ENGINE_NATBIB_NUMERICAL)
+ if (engine == biblio::ENGINE_BASIC ||
+ engine == biblio::ENGINE_NATBIB_NUMERICAL)
return getNumericalStrings(key, buf);
else
return getAuthorYearStrings(key, buf);
biblio::getCiteStyles(buf.params().getEngine());
vector<docstring> vec(styles.size());
- for (size_t i = 0; i != vec.size(); ++i) {
+ for (vector<docstring>::size_type i = 0; i != vec.size(); ++i) {
docstring str;
switch (styles[i]) {
str = from_ascii("[#ID]");
break;
+ case biblio::NOCITE:
+ str = _("Add to bibliography only.");
+ break;
+
case biblio::CITET:
str = author + " [#ID]";
break;
str = author + "/<" + _("before") + '>';
break;
+ case biblio::NOCITE:
+ str = _("Add to bibliography only.");
+ break;
+
case biblio::CITET:
str = author + " (" + year + ')';
break;
char const * const citeCommands[] = {
- "cite", "citet", "citep", "citealt", "citealp", "citeauthor",
- "citeyear", "citeyearpar" };
+ "cite", "nocite", "citet", "citep", "citealt", "citealp",
+ "citeauthor", "citeyear", "citeyearpar" };
unsigned int const nCiteCommands =
sizeof(citeCommands) / sizeof(char *);
CiteStyle const citeStyles[] = {
- CITE, CITET, CITEP, CITEALT, CITEALP,
-CITEAUTHOR, CITEYEAR, CITEYEARPAR };
+ CITE, NOCITE, CITET, CITEP, CITEALT,
+CITEALP, CITEAUTHOR, CITEYEAR, CITEYEARPAR };
unsigned int const nCiteStyles =
sizeof(citeStyles) / sizeof(CiteStyle);
}
char const * const * const last = citeCommands + nCiteCommands;
- char const * const * const ptr = std::find(citeCommands, last, cmd);
+ char const * const * const ptr = find(citeCommands, last, cmd);
if (ptr != last) {
size_t idx = ptr - citeCommands;
string cite = citeCommands[style];
if (full) {
CiteStyle const * last = citeStylesFull + nCiteStylesFull;
- if (std::find(citeStylesFull, last, style) != last)
+ if (find(citeStylesFull, last, style) != last)
cite += '*';
}
if (forceUCase) {
CiteStyle const * last = citeStylesUCase + nCiteStylesUCase;
- if (std::find(citeStylesUCase, last, style) != last)
+ if (find(citeStylesUCase, last, style) != last)
cite[0] = 'C';
}
switch (engine) {
case ENGINE_BASIC:
- nStyles = 1;
+ nStyles = 2;
start = 0;
break;
case ENGINE_NATBIB_AUTHORYEAR: