summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2003-03-08 14:22:15 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2003-03-08 14:22:15 (GMT)
commitb05064427c02bd5ae998856a0d708c440f610bde (patch)
treeeb0cd4bd519397a852945fb3acf64c0b65edcb2f /src/util.cpp
parent448b28836eb910f95e2f1903b4dea5eb8548e424 (diff)
downloadDoxygen-b05064427c02bd5ae998856a0d708c440f610bde.zip
Doxygen-b05064427c02bd5ae998856a0d708c440f610bde.tar.gz
Doxygen-b05064427c02bd5ae998856a0d708c440f610bde.tar.bz2
Release-1.3-rc3-20030308
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 98657a8..de34491 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -2535,6 +2535,28 @@ bool resolveRef(/* in */ const char *scName,
return FALSE;
}
+QCString linkToText(const char *link)
+{
+ QCString result=link;
+ if (!result.isEmpty())
+ {
+ // replace # by ::
+ result=substitute(result,"#","::");
+ // replace . by ::
+ result=substitute(result,".","::");
+ // strip :: prefix if present
+ if (result.at(0)==':' && result.at(1)==':')
+ {
+ result=result.right(result.length()-2);
+ }
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ {
+ result=substitute(result,"::",".");
+ }
+ }
+ return result;
+}
+
/*!
* generate a reference to a class, namespace or member.
* `scName' is the name of the scope that contains the documentation
@@ -2563,17 +2585,7 @@ bool generateRef(OutputDocInterface &od,const char *scName,
MemberDef *md;
// create default link text
- QCString linkText = rt;
- if (linkText.isEmpty())
- {
- linkText=substitute(name,"#","::");
- linkText=substitute(linkText,".","::");
- // strip :: prefix if present
- if (linkText.at(0)==':' && linkText.at(1)==':')
- {
- linkText=linkText.right(linkText.length()-2);
- }
- }
+ QCString linkText = linkToText(rt);
if (resolveRef(scName,name,inSeeBlock,&compound,&md))
{
@@ -2699,17 +2711,7 @@ bool generateLink(OutputDocInterface &od,const char *clName,
//printf("generateLink(clName=%s,lr=%s,lr=%s)\n",clName,lr,lt);
Definition *compound;
PageInfo *pageInfo;
- QCString anchor,linkText=lt;
- if (linkText.isEmpty())
- {
- linkText=substitute(lr,"#","::");
- linkText=substitute(linkText,".","::");
- // strip :: prefix if present
- if (linkText.at(0)==':' && linkText.at(1)==':')
- {
- linkText=linkText.right(linkText.length()-2);
- }
- }
+ QCString anchor,linkText=linkToText(lt);
//printf("generateLink linkText=%s\n",linkText.data());
if (resolveLink(clName,lr,inSeeBlock,&compound,&pageInfo,anchor))
{