summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2003-01-06 20:54:16 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2003-01-06 20:54:16 (GMT)
commitf781e6dbbaa51edbdbe9b5906be9962968d0ee68 (patch)
treeb008f56412d0734ea397eb4492ddd66c08677dff /src
parentdfa656f3404e589ad59c47dc1728744efb245a82 (diff)
downloadDoxygen-f781e6dbbaa51edbdbe9b5906be9962968d0ee68.zip
Doxygen-f781e6dbbaa51edbdbe9b5906be9962968d0ee68.tar.gz
Doxygen-f781e6dbbaa51edbdbe9b5906be9962968d0ee68.tar.bz2
Release-1.3-rc2-20030106
Diffstat (limited to 'src')
-rw-r--r--src/classdef.cpp14
-rw-r--r--src/classdef.h6
-rw-r--r--src/config.h5
-rw-r--r--src/docparser.cpp53
-rw-r--r--src/doctokenizer.l10
-rw-r--r--src/dot.cpp53
-rw-r--r--src/doxygen.cpp73
-rw-r--r--src/doxygen.h64
-rw-r--r--src/entry.h2
-rw-r--r--src/filedef.cpp2
-rw-r--r--src/filename.cpp1
-rw-r--r--src/index.cpp2
-rw-r--r--src/instdox.cpp2
-rw-r--r--src/membername.cpp1
-rw-r--r--src/page.h2
-rw-r--r--src/pngenc.cpp1
-rw-r--r--src/pre.h1
-rw-r--r--src/pre.l2
-rw-r--r--src/scanner.l7
-rw-r--r--src/sortdict.h4
-rw-r--r--src/tagreader.cpp13
-rw-r--r--src/treeview.h165
-rw-r--r--src/treeview.js165
-rw-r--r--src/util.cpp3
24 files changed, 460 insertions, 191 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index 426202d..24c68ab 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -124,6 +124,7 @@ ClassDef::~ClassDef()
delete m_innerClasses;
delete m_templateInstances;
delete m_templBaseClassNames;
+ delete m_tempArgs;
}
QCString ClassDef::displayName() const
@@ -1525,7 +1526,6 @@ void ClassDef::setTemplateArguments(ArgumentList *al)
if (al==0) return;
if (!m_tempArgs) delete m_tempArgs; // delete old list if needed
m_tempArgs=new ArgumentList;
- m_tempArgs->setAutoDelete(TRUE);
ArgumentListIterator ali(*al);
Argument *a;
for (;(a=ali.current());++ali)
@@ -1981,7 +1981,11 @@ void ClassDef::mergeMembers()
void ClassDef::addUsedClass(ClassDef *cd,const char *accessName)
{
- if (m_usesImplClassDict==0) m_usesImplClassDict = new UsesClassDict(17);
+ if (m_usesImplClassDict==0)
+ {
+ m_usesImplClassDict = new UsesClassDict(17);
+ m_usesImplClassDict->setAutoDelete(TRUE);
+ }
UsesClassDef *ucd=m_usesImplClassDict->find(cd->name());
if (ucd==0 /*|| ucd->templSpecifiers!=templSpec*/)
{
@@ -2065,7 +2069,11 @@ void ClassDef::determineImplUsageRelation()
if (cd) // class exists
{
found=TRUE;
- if (m_usesImplClassDict==0) m_usesImplClassDict = new UsesClassDict(257);
+ if (m_usesImplClassDict==0)
+ {
+ m_usesImplClassDict = new UsesClassDict(257);
+ m_usesImplClassDict->setAutoDelete(TRUE);
+ }
UsesClassDef *ucd=m_usesImplClassDict->find(cd->name());
if (ucd==0 || ucd->templSpecifiers!=templSpec)
{
diff --git a/src/classdef.h b/src/classdef.h
index 95997f7..86a3b3a 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -126,12 +126,6 @@ class ClassDef : public Definition
*/
ArgumentList *templateArguments() const { return m_tempArgs; }
- /*! Returns the template arguments that this nested class "inherits"
- * from its outer class (doxygen assumes there is only one!).
- * Will return 0 if not applicable.
- */
- //ArgumentList *outerTemplateArguments() const;
-
/*! Returns the namespace this compound is in, or 0 if it has a global
* scope.
*/
diff --git a/src/config.h b/src/config.h
index 4b00d22..4780c95 100644
--- a/src/config.h
+++ b/src/config.h
@@ -338,6 +338,11 @@ class Config
if (m_instance==0) m_instance = new Config;
return m_instance;
}
+ /*! Delete the instance */
+ static void deleteInstance()
+ {
+ delete m_instance;
+ }
/*! Returns an iterator that can by used to iterate over the
* configuration options.
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 42919fd..bc5d872 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -128,8 +128,8 @@ static void docParserPopContext()
//---------------------------------------------------------------------------
/*! search for an image in the imageNameDict and if found
- * copies the image to the output directory (which is the
- * html directory if type==0 or the latex directory if type==1)
+ * copies the image to the output directory (which depends on the \a type
+ * parameter).
*/
static QCString findAndCopyImage(const char *fileName,DocImage::Type type)
{
@@ -225,14 +225,20 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type)
return result;
}
+/*! Collects the parameters found with @param or @retval commands
+ * in a global list g_paramsFound. If \a isParam is set to TRUE
+ * and the parameter is not an actual parameter of the current
+ * member g_memberDef, than a warning is raised (unless warnings
+ * are disabled altogether).
+ */
static void checkArgumentName(const QString &name,bool isParam)
{
+ if (!Config_getBool("WARN_IF_DOC_ERROR")) return;
if (g_memberDef==0) return; // not a member
ArgumentList *al=g_memberDef->isDocsForDefinition() ?
g_memberDef->argumentList() :
g_memberDef->declArgumentList();
if (al==0) return; // no argument list
- if (!Config_getBool("WARN_IF_DOC_ERROR")) return;
static QRegExp re("[a-zA-Z0-9_]+\\.*");
int p=0,i=0,l;
@@ -270,6 +276,11 @@ static void checkArgumentName(const QString &name,bool isParam)
}
}
+/*! Checks if the parameters that have been specified using @param are
+ * indeed all paramters.
+ * Must be called after checkArgumentName() has been called for each
+ * argument.
+ */
static void checkUndocumentedParams()
{
if (g_memberDef && g_hasParamCommand && Config_getBool("WARN_IF_DOC_ERROR"))
@@ -317,6 +328,7 @@ static void checkUndocumentedParams()
//---------------------------------------------------------------------------
+/*! Strips know html and tex extensions from \a text. */
static QString stripKnownExtensions(const char *text)
{
QString result=text;
@@ -414,6 +426,7 @@ static bool findDocsForMemberOrCompound(const char *commandName,
QString *pDoc,
Definition **pDef)
{
+ //printf("findDocsForMemberOrCompound(%s)\n",commandName);
*pDoc="";
*pDef=0;
QString cmdArg=commandName;
@@ -422,10 +435,7 @@ static bool findDocsForMemberOrCompound(const char *commandName,
int funcStart=cmdArg.find('(');
if (funcStart==-1) funcStart=l;
- //int lastScopeStart=cmdArg.findRev("::",funcStart);
- //int lastScopeEnd = lastScopeStart==-1 ? 0 : lastScopeStart+2;
- //QString scope=cmdArg.left(QMAX(lastScopeStart,0));
- //QString name=cmdArg.mid(lastScopeEnd,funcStart-lastScopeEnd);
+
QString name=cmdArg.left(funcStart);
QString args=cmdArg.right(l-funcStart);
@@ -441,6 +451,7 @@ static bool findDocsForMemberOrCompound(const char *commandName,
name.latin1(),
args.isEmpty()?0:args.latin1(),
md,cd,fd,nd,gd,FALSE,0,TRUE);
+ //printf("found=%d context=%s name=%s\n",found,g_context.data(),name.data());
if (found && md)
{
*pDoc=md->documentation();
@@ -1289,7 +1300,14 @@ void DocCopy::parse()
if (g_copyStack.findRef(def)==-1) // definition not parsed earlier
{
docParserPushContext();
- g_context=def->name();
+ if (def->definitionType()==Definition::TypeMember && def->getOuterScope())
+ {
+ g_context=def->getOuterScope()->name();
+ }
+ else
+ {
+ g_context=def->name();
+ }
g_styleStack.clear();
g_nodeStack.clear();
g_copyStack.append(def);
@@ -3728,13 +3746,6 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag
retval=RetVal_ListItem;
}
break;
- //case HTML_PRE:
- // {
- // DocHtmlPre *pre = new DocHtmlPre(this,tagHtmlAttribs);
- // m_children.append(pre);
- // retval=pre->parse();
- // }
- // break;
case HTML_BOLD:
handleStyleEnter(this,m_children,DocStyleChange::Bold,&g_token->attribs);
break;
@@ -3836,7 +3847,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag
g_insideHtmlLink=FALSE;
break;
}
- else // unsupport option for tag a
+ else // unsupported option for tag a
{
}
}
@@ -4054,6 +4065,7 @@ int DocPara::parse()
{
DBG(("DocPara::parse() start\n"));
g_nodeStack.push(this);
+ // handle style commands "inherited" from the previous paragraph
handleInitialStyleCommands(this,m_children);
int tok;
int retval=0;
@@ -4083,7 +4095,7 @@ reparsetoken:
{
// prevent leading whitespace and collapse multiple whitespace areas
DocNode::Kind k;
- if (insidePRE(this) || // all whitespace is relavant
+ if (insidePRE(this) || // all whitespace is relevant
(
// remove leading whitespace
!m_children.isEmpty() &&
@@ -4197,12 +4209,7 @@ reparsetoken:
}
if (cmd&SIMPLESECT_BIT)
{
- if (n // already in a simple section
- //|| // no section or root as parent
- // (parent()->kind()!=DocNode::Kind_Root &&
- // parent()->kind()!=DocNode::Kind_Section
- // )
- )
+ if (n) // already in a simple section
{
// simple section cannot start in this paragraph, need
// to unwind the stack and remember the command.
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index de8937c..61a98b5 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -142,7 +142,7 @@ static int computeIndent(const char *str,int length)
*/
static void parseHtmlAttribs(const char *att)
{
- //printf("parseHtmlAttribs(%s)\n",opt.data());
+ //printf("parseHtmlAttribs(%s)\n",att);
QCString attribs=att;
int len = attribs.length();
char c;
@@ -173,7 +173,7 @@ static void parseHtmlAttribs(const char *att)
// search for matching quote
while (i<len && c!='\'') { c=attribs.at(++i); }
endAttrib=i;
- c=attribs.at(++i);
+ if (i<len) c=attribs.at(++i);
}
else if (attribs.at(i)=='"') // option "..."
{
@@ -182,7 +182,7 @@ static void parseHtmlAttribs(const char *att)
// search for matching quote
while (i<len && c!='"') { c=attribs.at(++i); }
endAttrib=i;
- c=attribs.at(++i);
+ if (i<len) c=attribs.at(++i);
}
else // value without any quotes
{
@@ -190,7 +190,7 @@ static void parseHtmlAttribs(const char *att)
// search for separator
while (i<len && c!=' ') { c=attribs.at(++i); }
endAttrib=i;
- c=attribs.at(++i);
+ if (i<len) c=attribs.at(++i);
}
opt.value = attribs.mid(startAttrib,endAttrib-startAttrib);
}
@@ -198,7 +198,7 @@ static void parseHtmlAttribs(const char *att)
{
}
//printf("=====> Adding option name=<%s> value=<%s>\n",
- // opt->name.data(),opt->value.data());
+ // opt.name.data(),opt.value.data());
g_token->attribs.append(&opt);
}
}
diff --git a/src/dot.cpp b/src/dot.cpp
index 70fa726..6fedd24 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -881,27 +881,25 @@ void DotGfxHierarchyTable::addClassList(ClassSDict *cl)
for (cli.toLast();(cd=cli.current());--cli)
{
//printf("Trying %s subClasses=%d\n",cd->name().data(),cd->subClasses()->count());
- if (!hasVisibleRoot(cd->baseClasses()))
+ if (!hasVisibleRoot(cd->baseClasses()) &&
+ cd->isVisibleInHierarchy()
+ ) // root node in the forest
{
- if (cd->isVisibleInHierarchy()) // root node in the forest
+ QCString tmp_url="";
+ if (cd->isLinkable())
+ tmp_url=cd->getReference()+"$"+cd->getOutputFileBase();
+ //printf("Inserting root class %s\n",cd->name().data());
+ DotNode *n = new DotNode(m_curNodeNumber++,
+ cd->displayName(),
+ tmp_url.data());
+
+ //m_usedNodes->clear();
+ m_usedNodes->insert(cd->name(),n);
+ m_rootNodes->insert(0,n);
+ if (!cd->visited && cd->subClasses()->count()>0)
{
- QCString tmp_url="";
- if (cd->isLinkable())
- tmp_url=cd->getReference()+"$"+cd->getOutputFileBase();
- //printf("Inserting root class %s\n",cd->name().data());
- DotNode *n = new DotNode(m_curNodeNumber++,
- cd->displayName(),
- tmp_url.data()
- );
-
- //m_usedNodes->clear();
- m_usedNodes->insert(cd->name(),n);
- m_rootNodes->insert(0,n);
- if (!cd->visited && cd->subClasses()->count()>0)
- {
- addHierarchy(n,cd,cd->visited);
- cd->visited=TRUE;
- }
+ addHierarchy(n,cd,cd->visited);
+ cd->visited=TRUE;
}
}
}
@@ -911,8 +909,8 @@ DotGfxHierarchyTable::DotGfxHierarchyTable()
{
m_curNodeNumber=0;
m_rootNodes = new QList<DotNode>;
- //m_rootNodes->setAutoDelete(TRUE); // rootNodes owns the nodes
- m_usedNodes = new QDict<DotNode>(1009); // virtualNodes only aliases nodes
+ m_usedNodes = new QDict<DotNode>(1009);
+ m_usedNodes->setAutoDelete(TRUE);
m_rootSubgraphs = new DotNodeList;
// build a graph with each class as a node and the inheritance relations
@@ -964,7 +962,9 @@ DotGfxHierarchyTable::DotGfxHierarchyTable()
DotGfxHierarchyTable::~DotGfxHierarchyTable()
{
//printf("DotGfxHierarchyTable::~DotGfxHierarchyTable\n");
- SDict<DotNode> skipNodes(17);
+
+#if 0 // TODO: delete this
+ SDict<DotNode> skipNodes(1009);
skipNodes.setAutoDelete(TRUE);
DotNode *n = m_rootNodes->first();
while (n)
@@ -980,6 +980,15 @@ DotGfxHierarchyTable::~DotGfxHierarchyTable()
deleteNodes(n,&skipNodes);
n=m_rootNodes->next();
}
+#endif
+
+ //QDictIterator<DotNode> di(*m_usedNodes);
+ //DotNode *n;
+ //for (;(n=di.current());++di)
+ //{
+ // printf("Node %p: %s\n",n,n->label().data());
+ //}
+
delete m_rootNodes;
delete m_usedNodes;
delete m_rootSubgraphs;
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 5b184d8..1eab93d 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
+#include <qtextcodec.h>
#include "version.h"
#include "doxygen.h"
@@ -61,6 +62,7 @@
//#include "packagedef.h"
#include "bufstr.h"
#include "commentcnv.h"
+#include "cmdmapper.h"
#if defined(_MSC_VER) || defined(__BORLANDC__)
#define popen _popen
@@ -104,8 +106,6 @@ StringDict Doxygen::tagDestinationDict(257); // all tag locations
QDict<void> Doxygen::expandAsDefinedDict(257); // all macros that should be expanded
QIntDict<MemberGroupInfo> Doxygen::memGrpInfoDict(1009); // dictionary of the member groups heading
-//QIntDict<QCString> Doxygen::memberHeaderDict(1009); // dictionary of the member groups heading
-//QIntDict<QCString> Doxygen::memberDocDict(1009); // dictionary of the member groups heading
PageInfo *Doxygen::mainPage = 0;
QTextStream Doxygen::tagFile;
@@ -3095,6 +3095,7 @@ static bool findTemplateInstanceRelation(Entry *root,
findUsedClassesForClass(templateRoot,templateClass,instanceClass,
isArtificial,templArgs,templateNames);
+ delete templArgs;
}
else
{
@@ -4468,7 +4469,6 @@ static void findMember(Entry *root,
* of the function definition before matching.
*/
argList = new ArgumentList;
- argList->setAutoDelete(TRUE);
substituteTemplatesInArgList(declTemplArgs,*defTemplArgs,
md->argumentList(),argList);
@@ -7048,6 +7048,37 @@ void initDoxygen()
initPreprocessor();
Doxygen::sectionDict.setAutoDelete(TRUE);
+ Doxygen::inputNameList.setAutoDelete(TRUE);
+ Doxygen::memberNameSDict.setAutoDelete(TRUE);
+ Doxygen::functionNameSDict.setAutoDelete(TRUE);
+ Doxygen::hiddenClasses.setAutoDelete(TRUE);
+ Doxygen::classSDict.setAutoDelete(TRUE);
+ Doxygen::pageSDict->setAutoDelete(TRUE);
+ Doxygen::exampleSDict->setAutoDelete(TRUE);
+ excludeNameDict.setAutoDelete(TRUE);
+ Doxygen::memGrpInfoDict.setAutoDelete(TRUE);
+ Doxygen::tagDestinationDict.setAutoDelete(TRUE);
+}
+
+void cleanUpDoxygen()
+{
+ delete Doxygen::inputNameDict;
+ delete Doxygen::includeNameDict;
+ delete Doxygen::exampleNameDict;
+ delete Doxygen::imageNameDict;
+ delete Doxygen::dotFileNameDict;
+ delete Doxygen::mainPage;
+ delete Doxygen::pageSDict;
+ delete Doxygen::exampleSDict;
+ delete Doxygen::globalScope;
+ delete Doxygen::specialLists;
+ cleanUpPreprocessor();
+ Config::deleteInstance();
+ QTextCodec::deleteAllCodecs();
+ delete theTranslator;
+ delete outputList;
+ CmdMapper::freeInstance();
+ HtmlTagMapper::freeInstance();
}
void readConfiguration(int argc, char **argv)
@@ -7093,6 +7124,7 @@ void readConfiguration(int argc, char **argv)
if (!formatName)
{
err("Error:option -e is missing format specifier rtf.\n");
+ cleanUpDoxygen();
exit(1);
}
if (stricmp(formatName,"rtf")==0)
@@ -7100,6 +7132,7 @@ void readConfiguration(int argc, char **argv)
if (optind+1>=argc)
{
err("Error: option \"-e rtf\" is missing an extensions file name\n");
+ cleanUpDoxygen();
exit(1);
}
QFile f;
@@ -7107,9 +7140,11 @@ void readConfiguration(int argc, char **argv)
{
RTFGenerator::writeExtensionsFile(f);
}
+ cleanUpDoxygen();
exit(1);
}
err("Error: option \"-e\" has invalid format specifier.\n");
+ cleanUpDoxygen();
exit(1);
break;
case 'w':
@@ -7117,6 +7152,7 @@ void readConfiguration(int argc, char **argv)
if (!formatName)
{
err("Error: option -w is missing format specifier rtf, html or latex\n");
+ cleanUpDoxygen();
exit(1);
}
if (stricmp(formatName,"rtf")==0)
@@ -7124,6 +7160,7 @@ void readConfiguration(int argc, char **argv)
if (optind+1>=argc)
{
err("Error: option \"-w rtf\" is missing a style sheet file name\n");
+ cleanUpDoxygen();
exit(1);
}
QFile f;
@@ -7131,6 +7168,7 @@ void readConfiguration(int argc, char **argv)
{
RTFGenerator::writeStyleSheetFile(f);
}
+ cleanUpDoxygen();
exit(1);
}
else if (stricmp(formatName,"html")==0)
@@ -7140,6 +7178,7 @@ void readConfiguration(int argc, char **argv)
if (!Config::instance()->parse(argv[optind+4]))
{
err("Error opening or reading configuration file %s!\n",argv[optind+4]);
+ cleanUpDoxygen();
exit(1);
}
Config::instance()->substituteEnvironmentVars();
@@ -7153,6 +7192,7 @@ void readConfiguration(int argc, char **argv)
if (optind+3>=argc)
{
err("Error: option \"-w html\" does not have enough arguments\n");
+ cleanUpDoxygen();
exit(1);
}
@@ -7176,7 +7216,8 @@ void readConfiguration(int argc, char **argv)
if (openOutputFile(argv[optind+3],f))
{
HtmlGenerator::writeStyleSheetFile(f);
- }
+ }
+ cleanUpDoxygen();
exit(0);
}
else if (stricmp(formatName,"latex")==0)
@@ -7199,6 +7240,7 @@ void readConfiguration(int argc, char **argv)
if (optind+2>=argc)
{
err("Error: option \"-w latex\" does not have enough arguments\n");
+ cleanUpDoxygen();
exit(1);
}
@@ -7218,11 +7260,13 @@ void readConfiguration(int argc, char **argv)
{
LatexGenerator::writeStyleSheetFile(f);
}
+ cleanUpDoxygen();
exit(0);
}
else
{
err("Error: Illegal format specifier %s: should be one of rtf, html, or latex\n",formatName);
+ cleanUpDoxygen();
exit(1);
}
break;
@@ -7234,6 +7278,7 @@ void readConfiguration(int argc, char **argv)
else if (strcmp(&argv[optind][2],"version")==0)
{
msg("%s\n",versionString);
+ cleanUpDoxygen();
exit(0);
}
break;
@@ -7257,6 +7302,7 @@ void readConfiguration(int argc, char **argv)
if (genConfig)
{
generateConfigFile(configName,shortList);
+ cleanUpDoxygen();
exit(0);
}
@@ -7295,12 +7341,14 @@ void readConfiguration(int argc, char **argv)
if (!Config::instance()->parse(configName))
{
err("Error: could not open or read configuration file %s!\n",configName);
+ cleanUpDoxygen();
exit(1);
}
if (updateConfig)
{
generateConfigFile(configName,shortList,TRUE);
+ cleanUpDoxygen();
exit(0);
}
@@ -7370,8 +7418,6 @@ void readConfiguration(int argc, char **argv)
void parseInput()
{
- Doxygen::classSDict.setAutoDelete(TRUE);
-
Doxygen::inputNameDict = new FileNameDict(10007);
Doxygen::includeNameDict = new FileNameDict(10007);
Doxygen::exampleNameDict = new FileNameDict(1009);
@@ -7602,6 +7648,8 @@ void parseInput()
if (input.isEmpty())
{
err("No input read, no output generated!\n");
+ delete root;
+ cleanUpDoxygen();
exit(1);
}
else
@@ -7628,6 +7676,8 @@ void parseInput()
{
err("Error: tag OUTPUT_DIRECTORY: Output directory `%s' does not "
"exist and cannot be created\n",outputDirectory.data());
+ delete root;
+ cleanUpDoxygen();
exit(1);
}
else if (!Config_getBool("QUIET"))
@@ -7654,6 +7704,8 @@ void parseInput()
if (generateHtml && !htmlDir.exists() && !htmlDir.mkdir(htmlOutput))
{
err("Could not create output directory %s\n",htmlOutput.data());
+ delete root;
+ cleanUpDoxygen();
exit(1);
}
@@ -7671,6 +7723,8 @@ void parseInput()
if (generateLatex && !latexDir.exists() && !latexDir.mkdir(latexOutput))
{
err("Could not create output directory %s\n",latexOutput.data());
+ delete root;
+ cleanUpDoxygen();
exit(1);
}
@@ -7688,6 +7742,8 @@ void parseInput()
if (generateRtf && !rtfDir.exists() && !rtfDir.mkdir(rtfOutput))
{
err("Could not create output directory %s\n",rtfOutput.data());
+ delete root;
+ cleanUpDoxygen();
exit(1);
}
@@ -7705,6 +7761,8 @@ void parseInput()
if (generateMan && !manDir.exists() && !manDir.mkdir(manOutput))
{
err("Could not create output directory %s\n",manOutput.data());
+ delete root;
+ cleanUpDoxygen();
exit(1);
}
@@ -7855,6 +7913,7 @@ void generateOutput()
* Initialize output generators *
**************************************************************************/
+
outputList = new OutputList(TRUE);
if (Config_getBool("GENERATE_HTML"))
{
@@ -7894,6 +7953,7 @@ void generateOutput()
err("Error: cannot open tag file %s for writing\n",
generateTagFile.data()
);
+ cleanUpDoxygen();
exit(1);
}
Doxygen::tagFile.setDevice(tag);
@@ -8069,5 +8129,6 @@ void generateOutput()
}
QDir::setCurrent(oldDir);
}
+ cleanUpDoxygen();
}
diff --git a/src/doxygen.h b/src/doxygen.h
index d102345..d33ed94 100644
--- a/src/doxygen.h
+++ b/src/doxygen.h
@@ -60,40 +60,38 @@ extern QCString spaces;
class Doxygen
{
public:
- static ClassSDict classSDict;
- static ClassSDict hiddenClasses;
- static PageSDict *exampleSDict;
- static PageSDict *pageSDict;
- static PageInfo *mainPage;
- static FileNameDict *includeNameDict;
- static FileNameDict *exampleNameDict;
- static FileNameDict *inputNameDict;
- static FileNameList inputNameList;
- static FileNameDict *imageNameDict;
- static FileNameDict *dotFileNameDict;
- static QStrList tagfileList;
- static MemberNameSDict memberNameSDict;
- static MemberNameSDict functionNameSDict;
- static FileList fileList;
- static FileDict fileDict;
- static ClassDef unrelatedClass;
- static QTextStream tagFile;
- static SectionDict sectionDict;
- static StringDict namespaceAliasDict;
- static GroupSDict groupSDict;
- static NamespaceSDict namespaceSDict;
- static FormulaList formulaList;
- static FormulaDict formulaDict;
- static FormulaDict formulaNameDict;
- static StringDict tagDestinationDict;
- static StringDict aliasDict;
+ static ClassSDict classSDict;
+ static ClassSDict hiddenClasses;
+ static PageSDict *exampleSDict;
+ static PageSDict *pageSDict;
+ static PageInfo *mainPage;
+ static FileNameDict *includeNameDict;
+ static FileNameDict *exampleNameDict;
+ static FileNameDict *inputNameDict;
+ static FileNameList inputNameList;
+ static FileNameDict *imageNameDict;
+ static FileNameDict *dotFileNameDict;
+ static QStrList tagfileList;
+ static MemberNameSDict memberNameSDict;
+ static MemberNameSDict functionNameSDict;
+ static FileList fileList;
+ static FileDict fileDict;
+ static ClassDef unrelatedClass;
+ static QTextStream tagFile;
+ static SectionDict sectionDict;
+ static StringDict namespaceAliasDict;
+ static GroupSDict groupSDict;
+ static NamespaceSDict namespaceSDict;
+ static FormulaList formulaList;
+ static FormulaDict formulaDict;
+ static FormulaDict formulaNameDict;
+ static StringDict tagDestinationDict;
+ static StringDict aliasDict;
static QIntDict<MemberGroupInfo> memGrpInfoDict;
- //static QIntDict<QCString> memberHeaderDict; // dictionary of the member groups heading
- //static QIntDict<QCString> memberDocDict; // dictionary of the member groups heading
- static QDict<void> expandAsDefinedDict;
- static NamespaceDef *globalScope;
- static QDict<RefList> *specialLists; // array of special lists: todo, test, bug, deprecated ...
- static QCString htmlFileExtension;
+ static QDict<void> expandAsDefinedDict;
+ static NamespaceDef *globalScope;
+ static QDict<RefList> *specialLists; // array of special lists: todo, test, bug, deprecated ...
+ static QCString htmlFileExtension;
};
void initDoxygen();
diff --git a/src/entry.h b/src/entry.h
index 5c0cdb4..ba4afbf 100644
--- a/src/entry.h
+++ b/src/entry.h
@@ -103,7 +103,7 @@ class ArgumentList : public QList<Argument>
ArgumentList() : QList<Argument>(),
constSpecifier(FALSE),
volatileSpecifier(FALSE),
- pureSpecifier(FALSE) {}
+ pureSpecifier(FALSE) { setAutoDelete(TRUE); }
/*! Destroys the argument list */
~ArgumentList() {}
bool hasDocumentation() const;
diff --git a/src/filedef.cpp b/src/filedef.cpp
index 01289e9..e48b398 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -73,6 +73,8 @@ FileDef::~FileDef()
delete classSDict;
delete includeDict;
delete includeList;
+ delete includedByDict;
+ delete includedByList;
delete namespaceSDict;
delete srcDefDict;
delete srcMemberDict;
diff --git a/src/filename.cpp b/src/filename.cpp
index 9b7e5b2..cbcceed 100644
--- a/src/filename.cpp
+++ b/src/filename.cpp
@@ -20,6 +20,7 @@
FileName::FileName(const char *fn,const char *n) : FileList()
{
+ setAutoDelete(TRUE);
fName=fn;
name=n;
}
diff --git a/src/index.cpp b/src/index.cpp
index 2073bb7..df48b79 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -1399,7 +1399,7 @@ void writeAlphabeticalClassList(OutputList &ol)
{
QCString namesp;
if (cd->getNamespaceDef()) namesp=cd->getNamespaceDef()->displayName();
- QCString cname=cd->displayName();
+ QCString cname=cd->className();
ol.writeObjectLink(cd->getReference(),
cd->getOutputFileBase(),0,cname);
diff --git a/src/instdox.cpp b/src/instdox.cpp
index cd803cd..3ae5760 100644
--- a/src/instdox.cpp
+++ b/src/instdox.cpp
@@ -127,7 +127,7 @@ void writeInstallScript()
t << "}\n";
t << "\n";
t << "if ( ! @files ) {\n";
- t << " print STDERR \"Warning: No input files given and non found!\\n\";\n";
+ t << " print STDERR \"Warning: No input files given and none found!\\n\";\n";
t << "}\n";
t << "\n";
t << "foreach $f (@files)\n";
diff --git a/src/membername.cpp b/src/membername.cpp
index 156e52c..59da4d9 100644
--- a/src/membername.cpp
+++ b/src/membername.cpp
@@ -23,6 +23,7 @@
MemberName::MemberName(const char *n) : QList<MemberDef>()
{
name=n;
+ setAutoDelete(TRUE);
}
MemberName::~MemberName()
diff --git a/src/page.h b/src/page.h
index 202a300..c7c7579 100644
--- a/src/page.h
+++ b/src/page.h
@@ -115,7 +115,7 @@ class PageSDict : public SDict<PageInfo>
{
public:
PageSDict(int size) : SDict<PageInfo>(size) {}
- ~PageSDict() {}
+ virtual ~PageSDict() {}
int compareItems(GCI i1,GCI i2)
{
return stricmp(((PageInfo *)i1)->name,((PageInfo *)i2)->name);
diff --git a/src/pngenc.cpp b/src/pngenc.cpp
index ce36b95..18d7085 100644
--- a/src/pngenc.cpp
+++ b/src/pngenc.cpp
@@ -106,6 +106,7 @@ void PngEncoder::write(const char *name)
PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE
);
+ free(png_palette);
ti[0] = transIndex;
png_set_tRNS(png_ptr,info_ptr,ti,1,NULL);
rows = (unsigned char **) calloc(sizeof(unsigned char*),height);
diff --git a/src/pre.h b/src/pre.h
index b3705a1..6213bfa 100644
--- a/src/pre.h
+++ b/src/pre.h
@@ -25,6 +25,7 @@
class BufStr;
void initPreprocessor();
+void cleanUpPreprocessor();
void addSearchDir(const char *dir);
void preprocessFile(const char *fileName,BufStr &output);
diff --git a/src/pre.l b/src/pre.l
index d85023f..5b55691 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -1919,7 +1919,7 @@ void initPreprocessor()
g_fileDefineDict = new DefineDict(1009);
}
-void cleanupPreprocessor()
+void cleanUpPreprocessor()
{
//delete fileDefineCache;
delete g_fileDefineDict; g_fileDefineDict=0;
diff --git a/src/scanner.l b/src/scanner.l
index c6b4eaf..aba1dca 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -2733,6 +2733,13 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
lastCContext = YY_START;
BEGIN(SkipCxxComment);
}
+<SkipInits>; {
+ warn(yyFileName,yyLineNr,
+ "Warning: Found ';' while parsing initializer list! "
+ "(doxygen could be confused by a macro call without semicolon)"
+ );
+ BEGIN( FindMembers );
+ }
<SkipInits,SkipCurly,SkipCurlyCpp>. {
//addToBody(yytext);
}
diff --git a/src/sortdict.h b/src/sortdict.h
index be4652c..903fea3 100644
--- a/src/sortdict.h
+++ b/src/sortdict.h
@@ -74,7 +74,7 @@ class SList : public QList<T>
{
public:
SList(SDict<T> *owner) : m_owner(owner) {}
- ~SList() {}
+ virtual ~SList() {}
int compareItems(GCI item1,GCI item2)
{
return m_owner->compareItems(item1,item2);
@@ -280,7 +280,7 @@ class SIntList : public QList<T>
{
public:
SIntList(SIntDict<T> *owner) : m_owner(owner) {}
- ~SIntList() {}
+ virtual ~SIntList() {}
int compareItems(GCI item1,GCI item2)
{
return m_owner->compareItems(item1,item2);
diff --git a/src/tagreader.cpp b/src/tagreader.cpp
index 1637044..8302eb5 100644
--- a/src/tagreader.cpp
+++ b/src/tagreader.cpp
@@ -186,6 +186,8 @@ class TagFileParser : public QXmlDefaultHandler
m_endElementHandlers(17),
m_tagName(tagName)
{
+ m_startElementHandlers.setAutoDelete(TRUE);
+ m_endElementHandlers.setAutoDelete(TRUE);
}
void startCompound( const QXmlAttributes& attrib )
@@ -305,7 +307,8 @@ class TagFileParser : public QXmlDefaultHandler
void endMember()
{
- m_state = *m_stateStack.pop();
+ m_state = *m_stateStack.top();
+ m_stateStack.remove();
switch(m_state)
{
case InClass: m_curClass->members.append(m_curMember); break;
@@ -884,6 +887,7 @@ void TagFileParser::buildMemberList(Entry *ce,QList<TagMemberInfo> &members)
me->args = tmi->arglist;
if (!me->args.isEmpty())
{
+ delete me->argList;
me->argList = new ArgumentList;
stringToArgumentList(me->args,me->argList);
}
@@ -1006,11 +1010,16 @@ void TagFileParser::buildLists(Entry *root)
// transfer base class list
if (tci->bases)
{
+ delete ce->extends;
ce->extends = tci->bases; tci->bases = 0;
}
if (tci->templateArguments)
{
- if (ce->tArgLists==0) ce->tArgLists = new QList<ArgumentList>;
+ if (ce->tArgLists==0)
+ {
+ ce->tArgLists = new QList<ArgumentList>;
+ ce->tArgLists->setAutoDelete(TRUE);
+ }
ArgumentList *al = new ArgumentList;
ce->tArgLists->append(al);
diff --git a/src/treeview.h b/src/treeview.h
index 9cbcccd..aa65bfe 100644
--- a/src/treeview.h
+++ b/src/treeview.h
@@ -103,13 +103,20 @@
" \n"
"function hideFolder() \n"
"{ \n"
-" if (browserVersion == 1 || browserVersion == 3) { \n"
+" if (browserVersion == 1 || browserVersion == 3) \n"
+" { \n"
" if (this.navObj.style.display == \"none\") \n"
-" return \n"
+" {\n"
+" return\n"
+" }\n"
" this.navObj.style.display = \"none\" \n"
-" } else { \n"
+" } \n"
+" else \n"
+" { \n"
" if (this.navObj.visibility == \"hidden\") \n"
+" {\n"
" return \n"
+" }\n"
" this.navObj.visibility = \"hidden\" \n"
" } \n"
" \n"
@@ -118,11 +125,11 @@
" \n"
"function initializeFolder(level, lastNode, leftSide) \n"
"{ \n"
-"var j=0 \n"
-"var i=0 \n"
-"var numberOfFolders \n"
-"var numberOfDocs \n"
-"var nc \n"
+" var j=0 \n"
+" var i=0 \n"
+" var numberOfFolders \n"
+" var numberOfDocs \n"
+" var nc \n"
" \n"
" nc = this.nChildren \n"
" \n"
@@ -166,9 +173,12 @@
" \n"
"function drawFolder(leftSide) \n"
"{ \n"
-" if (browserVersion == 2) { \n"
-" if (!doc.yPos) \n"
+" if (browserVersion == 2) \n"
+" { \n"
+" if (!doc.yPos)\n"
+" {\n"
" doc.yPos=8 \n"
+" }\n"
" doc.write(\"<layer id='folder\" + this.id + \"' top=\" + doc.yPos + \" visibility=hidden>\") \n"
" } \n"
" if (browserVersion == 3) \n"
@@ -178,7 +188,9 @@
" \n"
" doc.write(\"\\n<table \") \n"
" if (browserVersion == 1) \n"
+" {\n"
" doc.write(\" id='folder\" + this.id + \"' style='position:block;' \") \n"
+" }\n"
" doc.write(\" border=0 cellspacing=0 cellpadding=0>\") \n"
" doc.write(\"\\n<tr><td>\") \n"
" doc.write(leftSide) \n"
@@ -192,7 +204,9 @@
" doc.write(this.desc + \"</a>\") \n"
" } \n"
" else \n"
+" {\n"
" doc.write(this.desc) \n"
+" }\n"
" if (this.tagName!=\"\")\n"
" {\n"
" doc.write(\" [external]\")\n"
@@ -200,23 +214,30 @@
" doc.write(\"</td>\") \n"
" doc.write(\"\\n</table>\\n\") \n"
" \n"
-" if (browserVersion == 2) { \n"
+" if (browserVersion == 2) \n"
+" { \n"
" doc.write(\"</layer>\") \n"
" } \n"
-" if (browserVersion == 3) { \n"
+" if (browserVersion == 3) \n"
+" { \n"
" doc.write(\"</div>\") \n"
" } \n"
" \n"
-" if (browserVersion == 1) { \n"
+" if (browserVersion == 1) \n"
+" { \n"
" this.navObj = doc.all[\"folder\"+this.id] \n"
" this.iconImg = doc.all[\"folderIcon\"+this.id] \n"
" this.nodeImg = doc.all[\"nodeIcon\"+this.id] \n"
-" } else if (browserVersion == 2) { \n"
+" } \n"
+" else if (browserVersion == 2) \n"
+" { \n"
" this.navObj = doc.layers[\"folder\"+this.id] \n"
" this.iconImg = this.navObj.document.images[\"folderIcon\"+this.id] \n"
" this.nodeImg = this.navObj.document.images[\"nodeIcon\"+this.id] \n"
" doc.yPos=doc.yPos+this.navObj.clip.height \n"
-" } else if (browserVersion == 3) {\n"
+" } \n"
+" else if (browserVersion == 3) \n"
+" {\n"
" this.navObj = doc.getElementById(\"folder\"+this.id)\n"
" this.iconImg = doc.images.namedItem(\"folderIcon\"+this.id)\n"
" this.nodeImg = doc.images.namedItem(\"nodeIcon\"+this.id)\n"
@@ -303,6 +324,7 @@
" this.createIndex() \n"
" \n"
" if (level>0) \n"
+" {\n"
" if (lastNode) //the last 'brother' in the children array \n"
" { \n"
" this.renderOb(leftSide + \"<img src='ftv2lastnode.png' width=16 height=22>\") \n"
@@ -313,20 +335,29 @@
" this.renderOb(leftSide + \"<img src='ftv2node.png' width=16 height=22>\") \n"
" leftSide = leftSide + \"<img src='ftv2vertline.png' width=16 height=22>\" \n"
" } \n"
+" }\n"
" else \n"
+" {\n"
" this.renderOb(\"\") \n"
+" }\n"
"} \n"
" \n"
"function drawItem(leftSide) \n"
"{ \n"
-" if (browserVersion == 2) \n"
-" doc.write(\"<layer id='item\" + this.id + \"' top=\" + doc.yPos + \" visibility=hidden>\") \n"
-" if (browserVersion == 3) \n"
-" doc.write(\"<div id='item\" + this.id + \"' style='display:block;'>\") \n"
+" if (browserVersion == 2)\n"
+" {\n"
+" doc.write(\"<layer id='item\" + this.id + \"' top=\" + doc.yPos + \" visibility=hidden>\")\n"
+" }\n"
+" else if (browserVersion == 3)\n"
+" {\n"
+" doc.write(\"<div id='item\" + this.id + \"' style='display:block;'>\")\n"
+" }\n"
" \n"
" doc.write(\"\\n<table \") \n"
-" if (browserVersion == 1) \n"
-" doc.write(\" id='item\" + this.id + \"' style='position:block;' \") \n"
+" if (browserVersion == 1)\n"
+" {\n"
+" doc.write(\" id='item\" + this.id + \"' style='position:block;' \")\n"
+" }\n"
" doc.write(\" border=0 cellspacing=0 cellpadding=0>\\n\") \n"
" doc.write(\"<tr><td>\") \n"
" doc.write(leftSide) \n"
@@ -342,9 +373,13 @@
" } \n"
" doc.write(\"</td>\\n<td valign=middle nowrap>\") \n"
" if (USETEXTLINKS && this.link!=\"\") \n"
+" {\n"
" doc.write(\"<a href=\" + this.link + \">\" + this.desc + \"</a>\") \n"
+" }\n"
" else \n"
+" {\n"
" doc.write(this.desc) \n"
+" }\n"
" if (this.tagName!=\"\")\n"
" {\n"
" doc.write(\" [external]\");\n"
@@ -352,18 +387,27 @@
" doc.write(\"\\n</table>\\n\") \n"
" \n"
" if (browserVersion == 2) \n"
+" {\n"
" doc.write(\"</layer>\") \n"
-" if (browserVersion == 3) \n"
+" }\n"
+" else if (browserVersion == 3) \n"
+" {\n"
" doc.write(\"</div>\")\n"
+" }\n"
" \n"
-" if (browserVersion == 1) { \n"
+" if (browserVersion == 1) \n"
+" { \n"
" this.navObj = doc.all[\"item\"+this.id] \n"
" this.iconImg = doc.all[\"itemIcon\"+this.id] \n"
-" } else if (browserVersion == 2) { \n"
+" } \n"
+" else if (browserVersion == 2) \n"
+" { \n"
" this.navObj = doc.layers[\"item\"+this.id] \n"
" this.iconImg = this.navObj.document.images[\"itemIcon\"+this.id] \n"
" doc.yPos=doc.yPos+this.navObj.clip.height \n"
-" } else if (browserVersion == 3) {\n"
+" } \n"
+" else if (browserVersion == 3) \n"
+" {\n"
" this.navObj = doc.getElementById(\"item\"+this.id)\n"
" this.iconImg = doc.images.namedItem(\"itemIcon\"+this.id)\n"
" }\n"
@@ -376,9 +420,13 @@
"function display() \n"
"{ \n"
" if (browserVersion == 1 || browserVersion == 3) \n"
+" {\n"
" this.navObj.style.display = \"block\" \n"
+" }\n"
" else \n"
-" this.navObj.visibility = \"show\" \n"
+" {\n"
+" this.navObj.visibility = \"show\"\n"
+" }\n"
"} \n"
" \n"
"function createEntryIndex() \n"
@@ -429,18 +477,49 @@
" clickedFolder.setState(!state) //open<->close \n"
"} \n"
" \n"
+"function preLoadIcons() \n"
+"{\n"
+" var auxImg\n"
+" auxImg = new Image();\n"
+" auxImg.src = \"ftv2blank.png\";\n"
+" auxImg.src = \"ftv2doc.png\";\n"
+" auxImg.src = \"ftv2folderclosed.png\";\n"
+" auxImg.src = \"ftv2folderopen.png\";\n"
+" auxImg.src = \"ftv2lastnode.png\";\n"
+" auxImg.src = \"ftv2link.png\";\n"
+" auxImg.src = \"ftv2mlastnode.png\";\n"
+" auxImg.src = \"ftv2mnode.png\";\n"
+" auxImg.src = \"ftv2node.png\";\n"
+" auxImg.src = \"ftv2plastnode.png\";\n"
+" auxImg.src = \"ftv2pnode.png\";\n"
+" auxImg.src = \"ftv2vertline.png\";\n"
+"}\n"
+"\n"
"function initializeDocument() \n"
"{ \n"
-" doc = document;\n"
-" if (doc.all) \n"
-" browserVersion = 1 //IE4 \n"
-" else \n"
-" if (doc.layers) \n"
-" browserVersion = 2 //NS4 \n"
-" else if(navigator.userAgent.toLowerCase().indexOf('gecko') != -1)\n"
-" browserVersion = 3 //mozilla\n"
-" else \n"
-" browserVersion = 0 //other \n"
+" preLoadIcons()\n"
+"\n"
+" var ua = window.navigator.userAgent.toLowerCase();\n"
+" if ((ua.indexOf('msie')!=-1) && (navigator.version>=4))\n"
+" {\n"
+" browserVersion = 1 // IE >= 4.x\n"
+" }\n"
+" else if (ua.indexOf('opera')!=-1)\n"
+" {\n"
+" browserVersion = 3; // Opera\n"
+" }\n"
+" else if (ua.indexOf('gecko')!=-1)\n"
+" {\n"
+" browserVersion = 3; // NS6 or Mozilla\n"
+" }\n"
+" else if (ua.indexOf('mozilla')!=-1)\n"
+" {\n"
+" browserVersion = 2; // NS4\n"
+" }\n"
+" else\n"
+" {\n"
+" browserVersion = 0; // unknown or old browser\n"
+" }\n"
"\n"
" foldersTree.initialize(0, 1, \"\") \n"
" foldersTree.display()\n"
@@ -460,6 +539,7 @@
"// Auxiliary Functions for Folder-Treee backward compatibility \n"
"// ********************************************************* \n"
" \n"
+" \n"
"function gFld(description, tagName, hreference) \n"
"{ \n"
" folder = new Folder(description, tagName, hreference) \n"
@@ -492,9 +572,10 @@
"// Global variables \n"
"// **************** \n"
" \n"
-"USETEXTLINKS = 1\n"
-"indexOfEntries = new Array \n"
-"nEntries = 0 \n"
-"doc = document \n"
-"browserVersion = 0 \n"
-"selectedFolder=0\n"
+"var USETEXTLINKS = 1\n"
+"var indexOfEntries = new Array \n"
+"var nEntries = 0 \n"
+"var doc = document \n"
+"var browserVersion = 0 \n"
+"var selectedFolder=0\n"
+"\n"
diff --git a/src/treeview.js b/src/treeview.js
index 6b5ef51..a9ff9b5 100644
--- a/src/treeview.js
+++ b/src/treeview.js
@@ -103,13 +103,20 @@ function propagateChangesInState(folder)
function hideFolder()
{
- if (browserVersion == 1 || browserVersion == 3) {
+ if (browserVersion == 1 || browserVersion == 3)
+ {
if (this.navObj.style.display == "none")
- return
+ {
+ return
+ }
this.navObj.style.display = "none"
- } else {
+ }
+ else
+ {
if (this.navObj.visibility == "hidden")
+ {
return
+ }
this.navObj.visibility = "hidden"
}
@@ -118,11 +125,11 @@ function hideFolder()
function initializeFolder(level, lastNode, leftSide)
{
-var j=0
-var i=0
-var numberOfFolders
-var numberOfDocs
-var nc
+ var j=0
+ var i=0
+ var numberOfFolders
+ var numberOfDocs
+ var nc
nc = this.nChildren
@@ -166,9 +173,12 @@ var nc
function drawFolder(leftSide)
{
- if (browserVersion == 2) {
- if (!doc.yPos)
+ if (browserVersion == 2)
+ {
+ if (!doc.yPos)
+ {
doc.yPos=8
+ }
doc.write("<layer id='folder" + this.id + "' top=" + doc.yPos + " visibility=hidden>")
}
if (browserVersion == 3)
@@ -178,7 +188,9 @@ function drawFolder(leftSide)
doc.write("\n<table ")
if (browserVersion == 1)
+ {
doc.write(" id='folder" + this.id + "' style='position:block;' ")
+ }
doc.write(" border=0 cellspacing=0 cellpadding=0>")
doc.write("\n<tr><td>")
doc.write(leftSide)
@@ -192,7 +204,9 @@ function drawFolder(leftSide)
doc.write(this.desc + "</a>")
}
else
+ {
doc.write(this.desc)
+ }
if (this.tagName!="")
{
doc.write(" [external]")
@@ -200,23 +214,30 @@ function drawFolder(leftSide)
doc.write("</td>")
doc.write("\n</table>\n")
- if (browserVersion == 2) {
+ if (browserVersion == 2)
+ {
doc.write("</layer>")
}
- if (browserVersion == 3) {
+ if (browserVersion == 3)
+ {
doc.write("</div>")
}
- if (browserVersion == 1) {
+ if (browserVersion == 1)
+ {
this.navObj = doc.all["folder"+this.id]
this.iconImg = doc.all["folderIcon"+this.id]
this.nodeImg = doc.all["nodeIcon"+this.id]
- } else if (browserVersion == 2) {
+ }
+ else if (browserVersion == 2)
+ {
this.navObj = doc.layers["folder"+this.id]
this.iconImg = this.navObj.document.images["folderIcon"+this.id]
this.nodeImg = this.navObj.document.images["nodeIcon"+this.id]
doc.yPos=doc.yPos+this.navObj.clip.height
- } else if (browserVersion == 3) {
+ }
+ else if (browserVersion == 3)
+ {
this.navObj = doc.getElementById("folder"+this.id)
this.iconImg = doc.images.namedItem("folderIcon"+this.id)
this.nodeImg = doc.images.namedItem("nodeIcon"+this.id)
@@ -303,6 +324,7 @@ function initializeItem(level, lastNode, leftSide)
this.createIndex()
if (level>0)
+ {
if (lastNode) //the last 'brother' in the children array
{
this.renderOb(leftSide + "<img src='ftv2lastnode.png' width=16 height=22>")
@@ -313,20 +335,29 @@ function initializeItem(level, lastNode, leftSide)
this.renderOb(leftSide + "<img src='ftv2node.png' width=16 height=22>")
leftSide = leftSide + "<img src='ftv2vertline.png' width=16 height=22>"
}
+ }
else
+ {
this.renderOb("")
+ }
}
function drawItem(leftSide)
{
- if (browserVersion == 2)
- doc.write("<layer id='item" + this.id + "' top=" + doc.yPos + " visibility=hidden>")
- if (browserVersion == 3)
- doc.write("<div id='item" + this.id + "' style='display:block;'>")
+ if (browserVersion == 2)
+ {
+ doc.write("<layer id='item" + this.id + "' top=" + doc.yPos + " visibility=hidden>")
+ }
+ else if (browserVersion == 3)
+ {
+ doc.write("<div id='item" + this.id + "' style='display:block;'>")
+ }
doc.write("\n<table ")
- if (browserVersion == 1)
- doc.write(" id='item" + this.id + "' style='position:block;' ")
+ if (browserVersion == 1)
+ {
+ doc.write(" id='item" + this.id + "' style='position:block;' ")
+ }
doc.write(" border=0 cellspacing=0 cellpadding=0>\n")
doc.write("<tr><td>")
doc.write(leftSide)
@@ -342,9 +373,13 @@ function drawItem(leftSide)
}
doc.write("</td>\n<td valign=middle nowrap>")
if (USETEXTLINKS && this.link!="")
+ {
doc.write("<a href=" + this.link + ">" + this.desc + "</a>")
+ }
else
+ {
doc.write(this.desc)
+ }
if (this.tagName!="")
{
doc.write(" [external]");
@@ -352,18 +387,27 @@ function drawItem(leftSide)
doc.write("\n</table>\n")
if (browserVersion == 2)
+ {
doc.write("</layer>")
- if (browserVersion == 3)
+ }
+ else if (browserVersion == 3)
+ {
doc.write("</div>")
+ }
- if (browserVersion == 1) {
+ if (browserVersion == 1)
+ {
this.navObj = doc.all["item"+this.id]
this.iconImg = doc.all["itemIcon"+this.id]
- } else if (browserVersion == 2) {
+ }
+ else if (browserVersion == 2)
+ {
this.navObj = doc.layers["item"+this.id]
this.iconImg = this.navObj.document.images["itemIcon"+this.id]
doc.yPos=doc.yPos+this.navObj.clip.height
- } else if (browserVersion == 3) {
+ }
+ else if (browserVersion == 3)
+ {
this.navObj = doc.getElementById("item"+this.id)
this.iconImg = doc.images.namedItem("itemIcon"+this.id)
}
@@ -376,9 +420,13 @@ function drawItem(leftSide)
function display()
{
if (browserVersion == 1 || browserVersion == 3)
+ {
this.navObj.style.display = "block"
+ }
else
- this.navObj.visibility = "show"
+ {
+ this.navObj.visibility = "show"
+ }
}
function createEntryIndex()
@@ -429,18 +477,49 @@ function clickOnNode(folderId)
clickedFolder.setState(!state) //open<->close
}
+function preLoadIcons()
+{
+ var auxImg
+ auxImg = new Image();
+ auxImg.src = "ftv2blank.png";
+ auxImg.src = "ftv2doc.png";
+ auxImg.src = "ftv2folderclosed.png";
+ auxImg.src = "ftv2folderopen.png";
+ auxImg.src = "ftv2lastnode.png";
+ auxImg.src = "ftv2link.png";
+ auxImg.src = "ftv2mlastnode.png";
+ auxImg.src = "ftv2mnode.png";
+ auxImg.src = "ftv2node.png";
+ auxImg.src = "ftv2plastnode.png";
+ auxImg.src = "ftv2pnode.png";
+ auxImg.src = "ftv2vertline.png";
+}
+
function initializeDocument()
{
- doc = document;
- if (doc.all)
- browserVersion = 1 //IE4
- else
- if (doc.layers)
- browserVersion = 2 //NS4
- else if(navigator.userAgent.toLowerCase().indexOf('gecko') != -1)
- browserVersion = 3 //mozilla
- else
- browserVersion = 0 //other
+ preLoadIcons()
+
+ var ua = window.navigator.userAgent.toLowerCase();
+ if ((ua.indexOf('msie')!=-1) && (navigator.version>=4))
+ {
+ browserVersion = 1 // IE >= 4.x
+ }
+ else if (ua.indexOf('opera')!=-1)
+ {
+ browserVersion = 3; // Opera
+ }
+ else if (ua.indexOf('gecko')!=-1)
+ {
+ browserVersion = 3; // NS6 or Mozilla
+ }
+ else if (ua.indexOf('mozilla')!=-1)
+ {
+ browserVersion = 2; // NS4
+ }
+ else
+ {
+ browserVersion = 0; // unknown or old browser
+ }
foldersTree.initialize(0, 1, "")
foldersTree.display()
@@ -460,6 +539,7 @@ function initializeDocument()
// Auxiliary Functions for Folder-Treee backward compatibility
// *********************************************************
+
function gFld(description, tagName, hreference)
{
folder = new Folder(description, tagName, hreference)
@@ -492,9 +572,10 @@ function insDoc(parentFolder, document)
// Global variables
// ****************
-USETEXTLINKS = 1
-indexOfEntries = new Array
-nEntries = 0
-doc = document
-browserVersion = 0
-selectedFolder=0
+var USETEXTLINKS = 1
+var indexOfEntries = new Array
+var nEntries = 0
+var doc = document
+var browserVersion = 0
+var selectedFolder=0
+
diff --git a/src/util.cpp b/src/util.cpp
index 15e6e2e..b0b2244 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -766,6 +766,9 @@ void linkifyText(const TextGeneratorIntf &out,const char *scName,const char *nam
// );
// check if `word' is a documented class name
if (!word.isEmpty() &&
+ !(isdigit(word.at(0)) || word.at(0)=='-') &&
+ // do not try to link digits
+ // (saves a lot of time for large arrays)
!rightScopeMatch(word,searchName) &&
!rightScopeMatch(scopeName,word)
)