summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-07-29 16:00:57 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-07-29 16:00:57 (GMT)
commit89f9d113d0d788552a32b699a89f273f6ce58c0f (patch)
treef655c8c9491080aa1732a679732ee0085f81a374
parent30cfbe69de24e6d1d6b718971168be1ac246e3e2 (diff)
downloadDoxygen-89f9d113d0d788552a32b699a89f273f6ce58c0f.zip
Doxygen-89f9d113d0d788552a32b699a89f273f6ce58c0f.tar.gz
Doxygen-89f9d113d0d788552a32b699a89f273f6ce58c0f.tar.bz2
crossref citations are shown unconditionally
The crossref items in a bib file are unconditionally added to the list of used citations although the the citation to which the crossref belongs to is not used. This has been fixed. The problem was seen in the CGAL output. Note: a crossref in LaTeX is a bit different from the normal understanding of cross-reference, from https://tex.stackexchange.com/questions/401138/what-is-the-bibtex-crossref-field-used-for: "crossref can be used if you have multiple entries referring to the same proceeding, book or similar."
-rw-r--r--src/cite.cpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/cite.cpp b/src/cite.cpp
index 78df0c3..d02cb75 100644
--- a/src/cite.cpp
+++ b/src/cite.cpp
@@ -139,6 +139,7 @@ void CitationManager::generatePage()
input.at(fi.size())='\0';
int pos=0;
int s;
+ QCString label1;
while ((s=input.find('\n',pos))!=-1)
{
QCString line = input.mid((uint)pos,(uint)(s-pos));
@@ -152,12 +153,48 @@ void CitationManager::generatePage()
if (j!=-1 && k!=-1)
{
QCString label = line.mid((uint)(j+1),(uint)(k-j-1));
- if (p->entries.find(label.data())==p->entries.end()) // not found yet
+ // check if the reference with the cross reference is used
+ // insert cross refererence when cross reference has not yet been added.
+ if ((p->entries.find(label1.data())!=p->entries.end()) &&
+ (p->entries.find(label.data())==p->entries.end())) // not found yet
{
insert(label);
}
}
}
+ else if (line.stripWhiteSpace().startsWith("@"))
+ {
+ // assumption entry like: "@book { name," or "@book { name" (spaces optional)
+ int j=line.find("{",0);
+ // when no {, go hunting for it
+ while (j==-1 && (s=input.find('\n',pos))!=-1)
+ {
+ line = input.mid((uint)pos,(uint)(s-pos));
+ j=line.find("{",0);
+ pos=s+1;
+ }
+ // search for the name
+ label1 = "";
+ while (label1.isEmpty())
+ {
+ int k=line.find(",",j);
+ if (k != -1)
+ {
+ label1 = line.mid((uint)(j+1),(uint)(k-j-1));
+ }
+ else
+ {
+ label1 = line.mid((uint)(j+1));
+ }
+ label1 = label1.stripWhiteSpace();
+ j = -1;
+ if (label1.isEmpty() && (s=input.find('\n',pos))!=-1)
+ {
+ line = input.mid((uint)pos,(uint)(s-pos));
+ pos=s+1;
+ }
+ }
+ }
}
}
}