summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-05-20 14:35:05 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-05-20 14:35:05 (GMT)
commit5a7cb5383abbd105c22dca28171806bd2a5a9cda (patch)
tree36be5408c1204bd5806673cb3fef2b25ed031174 /src/util.cpp
parent697375aff0beddb756025e867289213dc46ca45f (diff)
downloadDoxygen-5a7cb5383abbd105c22dca28171806bd2a5a9cda.zip
Doxygen-5a7cb5383abbd105c22dca28171806bd2a5a9cda.tar.gz
Doxygen-5a7cb5383abbd105c22dca28171806bd2a5a9cda.tar.bz2
Release-1.2.16
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 1b7b78c..83dd2a2 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -2166,8 +2166,15 @@ bool getScopeDefs(const char *docScope,const char *scope,
//printf("getScopeDefs: docScope=`%s' scope=`%s'\n",docScope,scope);
if (scopeName.isEmpty()) return FALSE;
+ bool explicitGlobalScope=FALSE;
+ if (scopeName.at(0)==':' && scopeName.at(1)==':')
+ {
+ scopeName=scopeName.right(scopeName.length()-2);
+ explicitGlobalScope=TRUE;
+ }
+
QCString docScopeName=docScope;
- int scopeOffset=docScopeName.length();
+ int scopeOffset=explicitGlobalScope ? 0 : docScopeName.length();
do // for each possible docScope (from largest to and including empty)
{
@@ -2195,6 +2202,14 @@ bool getScopeDefs(const char *docScope,const char *scope,
return FALSE;
}
+static bool isLowerCase(QCString &s)
+{
+ char *p=s.data();
+ int c;
+ while ((c=*p++)) if (!islower(c)) return FALSE;
+ return TRUE;
+}
+
/*!
* generate a reference to a class, namespace or member.
* `scName' is the name of the scope that contains the documentation
@@ -2229,7 +2244,26 @@ bool generateRef(OutputDocInterface &od,const char *scName,
{
ClassDef *cd=0;
NamespaceDef *nd=0;
- if (linkText.isEmpty()) linkText=tmpName;
+
+ if (linkText.isEmpty())
+ {
+ linkText=tmpName;
+ // strip :: prefix if present
+ if (linkText.at(0)==':' && linkText.at(1)==':')
+ {
+ linkText=linkText.right(linkText.length()-2);
+ }
+ }
+
+ if (scopePos==-1 && isLowerCase(tsName))
+ { // link to lower case only name => do not try to autolink
+ od.docify(linkText);
+ // text has been written, stop now.
+ return FALSE;
+ }
+
+ //printf("scName=%s tmpName=%s\n",scName,tmpName.data());
+
// check if this is a class or namespace reference
if (scName!=tmpName && getScopeDefs(scName,name,cd,nd))
{