Allow \nocite again with the basic citation engine (backport r39777).

Fix a bug introduced in r26547. Also reorders the entries for
natbib-numerical into a more natural, visually pleasing order.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39830 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Julien Rioux 2011-10-11 18:33:35 +00:00
parent e2a82f44bd
commit 1c56ffc10f
2 changed files with 23 additions and 16 deletions

View File

@ -1033,30 +1033,35 @@ string citationStyleToString(const CitationStyle & s)
vector<CiteStyle> citeStyles(CiteEngine engine) vector<CiteStyle> citeStyles(CiteEngine engine)
{ {
unsigned int nStyles = 0; vector<CiteStyle> styles(0);
unsigned int start = 0;
switch (engine) { switch (engine) {
case ENGINE_BASIC: case ENGINE_BASIC:
nStyles = 2; styles.push_back(CITE);
start = 0;
break;
case ENGINE_NATBIB_AUTHORYEAR:
case ENGINE_NATBIB_NUMERICAL:
nStyles = nCiteStyles - 1;
start = 1;
break; break;
case ENGINE_JURABIB: case ENGINE_JURABIB:
nStyles = nCiteStyles; styles.push_back(CITE);
start = 0; case ENGINE_NATBIB_AUTHORYEAR:
styles.push_back(CITET);
styles.push_back(CITEP);
styles.push_back(CITEALT);
styles.push_back(CITEALP);
styles.push_back(CITEAUTHOR);
styles.push_back(CITEYEAR);
styles.push_back(CITEYEARPAR);
break;
case ENGINE_NATBIB_NUMERICAL:
styles.push_back(CITET);
styles.push_back(CITEALT);
styles.push_back(CITEAUTHOR);
styles.push_back(CITEP);
styles.push_back(CITEALP);
styles.push_back(CITEYEAR);
styles.push_back(CITEYEARPAR);
break; break;
} }
vector<CiteStyle> styles(nStyles); styles.push_back(NOCITE);
size_t i = 0;
int j = start;
for (; i != styles.size(); ++i, ++j)
styles[i] = citeStylesArray[j];
return styles; return styles;
} }

View File

@ -146,6 +146,8 @@ What's new
- Don't allow copy-pasting newline characters in Document->Settings - Don't allow copy-pasting newline characters in Document->Settings
and Tools->Preferences (bug 5840). and Tools->Preferences (bug 5840).
- Allow the \nocite LaTeX command when using the basic citation engine.
* ADVANCED FIND AND REPLACE * ADVANCED FIND AND REPLACE