Skip to content

Commit b0fa2c5

Browse files
committed
issue #10907 Cite command creates case sensitivity on name
Relaxing the restriction regarding the case sensitivity of the citation label. The name `CITEREF` is a doxygen name so it can be changed as well (tests).
1 parent c2002ae commit b0fa2c5

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/cite.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ void CitationManager::insert(const QCString &label)
7979
{
8080
p->entries.insert(
8181
std::make_pair(
82-
label.str(),
83-
std::make_unique<CiteInfoImpl>(label)
82+
label.lower().str(),
83+
std::make_unique<CiteInfoImpl>(label.lower())
8484
));
8585
}
8686

8787
const CiteInfo *CitationManager::find(const QCString &label) const
8888
{
89-
auto it = p->entries.find(label.str());
89+
auto it = p->entries.find(label.lower().str());
9090
if (it!=p->entries.end())
9191
{
9292
return it->second.get();
@@ -179,6 +179,7 @@ void CitationManager::insertCrossReferencesForBibFile(const QCString &bibFile)
179179
k = line.find(',');
180180
}
181181
}
182+
citeName = citeName.lower();
182183
}
183184
//printf("citeName = #%s#\n",qPrint(citeName));
184185
}
@@ -188,7 +189,7 @@ void CitationManager::insertCrossReferencesForBibFile(const QCString &bibFile)
188189
int k = line.find('}',i);
189190
if (j>i && k>j)
190191
{
191-
QCString crossrefName = line.mid(static_cast<size_t>(j+1),static_cast<uint32_t>(k-j-1));
192+
QCString crossrefName = line.mid(static_cast<size_t>(j+1),static_cast<uint32_t>(k-j-1)).lower();
192193
// check if the reference with the cross reference is used
193194
// insert cross reference when cross reference has not yet been added.
194195
if ((p->entries.find(citeName.str())!=p->entries.end()) &&

testing/012/citelist.xml

100644100755
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
<para>
1010
<variablelist>
1111
<varlistentry>
12-
<term><anchor id="citelist_1CITEREF_Be09"/>[1]</term>
12+
<term><anchor id="citelist_1CITEREF_be09"/>[1]</term>
1313
</varlistentry>
1414
<listitem>
15-
<para>P.<nonbreakablespace/>Belotti. <ulink url="https://link.springer.com/10.1007/978-1-4614-1927-3_5">Disjunctive cuts for non-convex MINLP</ulink>. In <ulink url="#CITEREF_LeLe12">Lee and Leyffer</ulink> <ulink url="#CITEREF_LeLe12">[4]</ulink>, pages 117<ndash/>144.</para>
15+
<para>P.<nonbreakablespace/>Belotti. <ulink url="https://link.springer.com/10.1007/978-1-4614-1927-3_5">Disjunctive cuts for non-convex MINLP</ulink>. In <ulink url="#CITEREF_lele12">Lee and Leyffer</ulink> <ulink url="#CITEREF_lele12">[4]</ulink>, pages 117<ndash/>144.</para>
1616
<para/>
1717
</listitem>
1818
<varlistentry>
19-
<term><anchor id="citelist_1CITEREF_BertholdHeinzVigerske2009"/>[2]</term>
19+
<term><anchor id="citelist_1CITEREF_bertholdheinzvigerske2009"/>[2]</term>
2020
</varlistentry>
2121
<listitem>
22-
<para>T.<nonbreakablespace/>Berthold, S.<nonbreakablespace/>Heinz, and S.<nonbreakablespace/>Vigerske. <ulink url="https://link.springer.com/10.1007/978-1-4614-1927-3_15">Extending a CIP framework to solve MIQCPs</ulink>. In <ulink url="#CITEREF_LeLe12">Lee and Leyffer</ulink> <ulink url="#CITEREF_LeLe12">[4]</ulink>, pages 427<ndash/>444.</para>
22+
<para>T.<nonbreakablespace/>Berthold, S.<nonbreakablespace/>Heinz, and S.<nonbreakablespace/>Vigerske. <ulink url="https://link.springer.com/10.1007/978-1-4614-1927-3_15">Extending a CIP framework to solve MIQCPs</ulink>. In <ulink url="#CITEREF_lele12">Lee and Leyffer</ulink> <ulink url="#CITEREF_lele12">[4]</ulink>, pages 427<ndash/>444.</para>
2323
<para/>
2424
</listitem>
2525
<varlistentry>
@@ -30,7 +30,7 @@
3030
<para/>
3131
</listitem>
3232
<varlistentry>
33-
<term><anchor id="citelist_1CITEREF_LeLe12"/>[4]</term>
33+
<term><anchor id="citelist_1CITEREF_lele12"/>[4]</term>
3434
</varlistentry>
3535
<listitem>
3636
<para>Jon Lee and Sven Leyffer, editors. <ulink url="https://link.springer.com/10.1007/978-1-4614-1927-3"><emphasis>Mixed Integer Nonlinear Programming</emphasis></ulink>, volume 154 of <emphasis>The IMA Volumes in Mathematics and its Applications</emphasis>. Springer, 2012.</para>

testing/012/indexpage.xml

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</briefdescription>
88
<detaileddescription>
99
<para>See <ref refid="citelist_1CITEREF_knuth79" kindref="member">[3]</ref> for more info.</para>
10-
<para>Other references with cross references see <ref refid="citelist_1CITEREF_Be09" kindref="member">[1]</ref> and <ref refid="citelist_1CITEREF_BertholdHeinzVigerske2009" kindref="member">[2]</ref> for more info. </para>
10+
<para>Other references with cross references see <ref refid="citelist_1CITEREF_be09" kindref="member">[1]</ref> and <ref refid="citelist_1CITEREF_bertholdheinzvigerske2009" kindref="member">[2]</ref> for more info. </para>
1111
</detaileddescription>
1212
<location file="012_cite.dox"/>
1313
</compounddef>

0 commit comments

Comments
 (0)