Commit 9b7e4ffb authored by Dimitri van Heesch's avatar Dimitri van Heesch

Fixed several Coverity warnings

parent e986e003
...@@ -550,6 +550,7 @@ int QFile::writeBlock( const char *p, uint len ) ...@@ -550,6 +550,7 @@ int QFile::writeBlock( const char *p, uint len )
return -1; return -1;
} }
#endif #endif
if (p==0) return 0;
int nwritten; // number of bytes written int nwritten; // number of bytes written
if ( isRaw() ) // raw file if ( isRaw() ) // raw file
nwritten = (int)WRITE( fd, p, len ); nwritten = (int)WRITE( fd, p, len );
......
...@@ -28,6 +28,7 @@ class CondParser ...@@ -28,6 +28,7 @@ class CondParser
{ {
// public functions // public functions
public: public:
CondParser() : m_e(0), m_tokenType(NOTHING) {}
bool parse(const char *fileName,int lineNr,const char *expr); bool parse(const char *fileName,int lineNr,const char *expr);
// enumerations // enumerations
......
...@@ -5760,7 +5760,8 @@ class ClassTreeContext::Private : public PropertyMapper ...@@ -5760,7 +5760,8 @@ class ClassTreeContext::Private : public PropertyMapper
SharedPtr<NestingContext> m_classTree; SharedPtr<NestingContext> m_classTree;
struct Cachable struct Cachable
{ {
Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} Cachable() : maxDepth(0), maxDepthComputed(FALSE),
preferredDepth(0), preferredDepthComputed(FALSE) {}
int maxDepth; int maxDepth;
bool maxDepthComputed; bool maxDepthComputed;
int preferredDepth; int preferredDepth;
...@@ -6168,7 +6169,8 @@ class FileTreeContext::Private : public PropertyMapper ...@@ -6168,7 +6169,8 @@ class FileTreeContext::Private : public PropertyMapper
SharedPtr<NestingContext> m_dirFileTree; SharedPtr<NestingContext> m_dirFileTree;
struct Cachable struct Cachable
{ {
Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} Cachable() : maxDepth(0), maxDepthComputed(FALSE),
preferredDepth(0), preferredDepthComputed(FALSE) {}
int maxDepth; int maxDepth;
bool maxDepthComputed; bool maxDepthComputed;
int preferredDepth; int preferredDepth;
......
...@@ -92,8 +92,8 @@ class DefinitionImpl ...@@ -92,8 +92,8 @@ class DefinitionImpl
DefinitionImpl::DefinitionImpl() DefinitionImpl::DefinitionImpl()
: sectionDict(0), sourceRefByDict(0), sourceRefsDict(0), : sectionDict(0), sourceRefByDict(0), sourceRefsDict(0),
xrefListItems(0), partOfGroups(0), xrefListItems(0), partOfGroups(0),
details(0), inbodyDocs(0), brief(0), body(0), details(0), inbodyDocs(0), brief(0), body(0), hidden(FALSE), isArtificial(FALSE),
outerScope(0) outerScope(0), lang(SrcLangExt_Unknown)
{ {
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
static int g_dirCount=0; static int g_dirCount=0;
DirDef::DirDef(const char *path) : Definition(path,1,1,path) DirDef::DirDef(const char *path) : Definition(path,1,1,path), visited(FALSE)
{ {
bool fullPathNames = Config_getBool("FULL_PATH_NAMES"); bool fullPathNames = Config_getBool("FULL_PATH_NAMES");
// get display name (stipping the paths mentioned in STRIP_FROM_PATH) // get display name (stipping the paths mentioned in STRIP_FROM_PATH)
......
...@@ -178,14 +178,14 @@ class TextGeneratorDocbookImpl : public TextGeneratorIntf ...@@ -178,14 +178,14 @@ class TextGeneratorDocbookImpl : public TextGeneratorIntf
class DocbookCodeGenerator : public CodeOutputInterface class DocbookCodeGenerator : public CodeOutputInterface
{ {
public: public:
DocbookCodeGenerator(FTextStream &t) : m_t(t), m_lineNumber(-1), DocbookCodeGenerator(FTextStream &t) : m_t(t), m_lineNumber(-1), m_col(0),
m_insideCodeLine(FALSE), m_insideSpecialHL(FALSE) {} m_insideCodeLine(FALSE), m_insideSpecialHL(FALSE) {}
virtual ~DocbookCodeGenerator() {} virtual ~DocbookCodeGenerator() {}
void codify(const char *text) void codify(const char *text)
{ {
Docbook_DB(("(codify \"%s\")\n",text)); Docbook_DB(("(codify \"%s\")\n",text));
writeDocbookCodeString(m_t,text,col); writeDocbookCodeString(m_t,text,m_col);
} }
void writeCodeLink(const char *ref,const char *file, void writeCodeLink(const char *ref,const char *file,
const char *anchor,const char *name, const char *anchor,const char *name,
...@@ -193,7 +193,7 @@ class DocbookCodeGenerator : public CodeOutputInterface ...@@ -193,7 +193,7 @@ class DocbookCodeGenerator : public CodeOutputInterface
{ {
Docbook_DB(("(writeCodeLink)\n")); Docbook_DB(("(writeCodeLink)\n"));
writeDocbookLink(m_t,ref,file,anchor,name,tooltip); writeDocbookLink(m_t,ref,file,anchor,name,tooltip);
col+=strlen(name); m_col+=strlen(name);
} }
void writeTooltip(const char *, const DocLinkInfo &, const char *, void writeTooltip(const char *, const DocLinkInfo &, const char *,
const char *, const SourceLinkInfo &, const SourceLinkInfo & const char *, const SourceLinkInfo &, const SourceLinkInfo &
...@@ -217,7 +217,7 @@ class DocbookCodeGenerator : public CodeOutputInterface ...@@ -217,7 +217,7 @@ class DocbookCodeGenerator : public CodeOutputInterface
} }
} }
m_insideCodeLine=TRUE; m_insideCodeLine=TRUE;
col=0; m_col=0;
} }
void endCodeLine() void endCodeLine()
{ {
...@@ -255,7 +255,6 @@ class DocbookCodeGenerator : public CodeOutputInterface ...@@ -255,7 +255,6 @@ class DocbookCodeGenerator : public CodeOutputInterface
{ {
m_refId=compId; m_refId=compId;
if (anchorId) m_refId+=(QCString)"_1"+anchorId; if (anchorId) m_refId+=(QCString)"_1"+anchorId;
m_isMemberRef = anchorId!=0;
if (extRef) m_external=extRef; if (extRef) m_external=extRef;
} }
} }
...@@ -275,8 +274,7 @@ class DocbookCodeGenerator : public CodeOutputInterface ...@@ -275,8 +274,7 @@ class DocbookCodeGenerator : public CodeOutputInterface
QCString m_refId; QCString m_refId;
QCString m_external; QCString m_external;
int m_lineNumber; int m_lineNumber;
bool m_isMemberRef; int m_col;
int col;
bool m_insideCodeLine; bool m_insideCodeLine;
bool m_insideSpecialHL; bool m_insideSpecialHL;
}; };
......
...@@ -2089,6 +2089,11 @@ DocFormula::DocFormula(DocNode *parent,int id) : ...@@ -2089,6 +2089,11 @@ DocFormula::DocFormula(DocNode *parent,int id) :
m_name.sprintf("form_%d",m_id); m_name.sprintf("form_%d",m_id);
m_text = formula->getFormulaText(); m_text = formula->getFormulaText();
} }
else // wrong \form#<n> command
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Wrong formula id %d",id);
m_id = -1;
}
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -2366,7 +2371,7 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) : ...@@ -2366,7 +2371,7 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) :
// compound->definitionType()); // compound->definitionType());
return; return;
} }
else if (compound->definitionType()==Definition::TypeFile && else if (compound && compound->definitionType()==Definition::TypeFile &&
((FileDef*)compound)->generateSourceFile() ((FileDef*)compound)->generateSourceFile()
) // undocumented file that has source code we can link to ) // undocumented file that has source code we can link to
{ {
...@@ -2486,8 +2491,7 @@ DocCite::DocCite(DocNode *parent,const QCString &target,const QCString &) //cont ...@@ -2486,8 +2491,7 @@ DocCite::DocCite(DocNode *parent,const QCString &target,const QCString &) //cont
DocLink::DocLink(DocNode *parent,const QCString &target) DocLink::DocLink(DocNode *parent,const QCString &target)
{ {
m_parent = parent; m_parent = parent;
Definition *compound; Definition *compound = 0;
//PageInfo *page;
QCString anchor; QCString anchor;
m_refText = target; m_refText = target;
m_relPath = g_relPath; m_relPath = g_relPath;
...@@ -2504,7 +2508,7 @@ DocLink::DocLink(DocNode *parent,const QCString &target) ...@@ -2504,7 +2508,7 @@ DocLink::DocLink(DocNode *parent,const QCString &target)
m_file = compound->getOutputFileBase(); m_file = compound->getOutputFileBase();
m_ref = compound->getReference(); m_ref = compound->getReference();
} }
else if (compound->definitionType()==Definition::TypeFile && else if (compound && compound->definitionType()==Definition::TypeFile &&
((FileDef*)compound)->generateSourceFile() ((FileDef*)compound)->generateSourceFile()
) // undocumented file that has source code we can link to ) // undocumented file that has source code we can link to
{ {
...@@ -3308,7 +3312,6 @@ int DocIndexEntry::parse() ...@@ -3308,7 +3312,6 @@ int DocIndexEntry::parse()
break; break;
} }
} }
if (tok!=0) retval=tok;
doctokenizerYYsetStatePara(); doctokenizerYYsetStatePara();
m_entry = m_entry.stripWhiteSpace(); m_entry = m_entry.stripWhiteSpace();
endindexentry: endindexentry:
...@@ -6788,15 +6791,11 @@ int DocSection::parse() ...@@ -6788,15 +6791,11 @@ int DocSection::parse()
(m_level<=2+Doxygen::subpageNestingLevel && retval==RetVal_Paragraph) (m_level<=2+Doxygen::subpageNestingLevel && retval==RetVal_Paragraph)
) )
{ {
int level; int level = (retval==RetVal_Subsubsection) ? 3 : 4;
if (retval==RetVal_Subsection) level=2;
else if (retval==RetVal_Subsubsection) level=3;
else level=4;
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected %s " warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected %s "
"command found inside %s!", "command found inside %s!",
sectionLevelToName[level],sectionLevelToName[m_level]); sectionLevelToName[level],sectionLevelToName[m_level]);
retval=0; // stop parsing retval=0; // stop parsing
} }
else else
{ {
......
...@@ -45,10 +45,13 @@ void FileName::generateDiskNames() ...@@ -45,10 +45,13 @@ void FileName::generateDiskNames()
{ {
// skip references // skip references
for (it.toFirst();(fd=it.current()) && fd->isReference();++it) { } for (it.toFirst();(fd=it.current()) && fd->isReference();++it) { }
if (fd)
{
// name if unique, so diskname is simply the name // name if unique, so diskname is simply the name
//printf("!!!!!!!! Unique disk name=%s for fd=%s\n",name.data(),fd->diskname.data()); //printf("!!!!!!!! Unique disk name=%s for fd=%s\n",name.data(),fd->diskname.data());
fd->m_diskName=name; fd->m_diskName=name;
} }
}
else if (count>1) // multiple occurrences of the same file name else if (count>1) // multiple occurrences of the same file name
{ {
//printf("Multiple occurrences of %s\n",name.data()); //printf("Multiple occurrences of %s\n",name.data());
...@@ -57,6 +60,8 @@ void FileName::generateDiskNames() ...@@ -57,6 +60,8 @@ void FileName::generateDiskNames()
while (!found) // search for the common prefix of all paths while (!found) // search for the common prefix of all paths
{ {
for (it.toFirst();(fd=it.current()) && fd->isReference();++it) { } for (it.toFirst();(fd=it.current()) && fd->isReference();++it) { }
if (fd)
{
char c=fd->m_path.at(i); char c=fd->m_path.at(i);
if (c=='/') j=i; // remember last position of dirname if (c=='/') j=i; // remember last position of dirname
++it; ++it;
...@@ -80,6 +85,7 @@ void FileName::generateDiskNames() ...@@ -80,6 +85,7 @@ void FileName::generateDiskNames()
} }
i++; i++;
} }
}
for (it.toFirst();(fd=it.current());++it) for (it.toFirst();(fd=it.current());++it)
{ {
//printf("fd->setName(%s)\n",(fd->path.right(fd->path.length()-j-1)+name).data()); //printf("fd->setName(%s)\n",(fd->path.right(fd->path.length()-j-1)+name).data());
......
...@@ -737,6 +737,8 @@ void HtmlGenerator::init() ...@@ -737,6 +737,8 @@ void HtmlGenerator::init()
if (f.open(IO_WriteOnly)) if (f.open(IO_WriteOnly))
{ {
const Resource *res = mgr.get("dynsections.js"); const Resource *res = mgr.get("dynsections.js");
if (res)
{
FTextStream t(&f); FTextStream t(&f);
t << (const char *)res->data; t << (const char *)res->data;
if (Config_getBool("SOURCE_BROWSER") && Config_getBool("SOURCE_TOOLTIPS")) if (Config_getBool("SOURCE_BROWSER") && Config_getBool("SOURCE_TOOLTIPS"))
...@@ -750,6 +752,11 @@ void HtmlGenerator::init() ...@@ -750,6 +752,11 @@ void HtmlGenerator::init()
"});\n"; "});\n";
} }
} }
else
{
err("Resource dynsections.js not compiled in");
}
}
} }
} }
...@@ -896,7 +903,6 @@ void HtmlGenerator::writeSearchInfo(FTextStream &t,const QCString &relPath) ...@@ -896,7 +903,6 @@ void HtmlGenerator::writeSearchInfo(FTextStream &t,const QCString &relPath)
t << " onmouseover=\"return searchBox.OnSearchSelectShow()\"\n"; t << " onmouseover=\"return searchBox.OnSearchSelectShow()\"\n";
t << " onmouseout=\"return searchBox.OnSearchSelectHide()\"\n"; t << " onmouseout=\"return searchBox.OnSearchSelectHide()\"\n";
t << " onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n"; t << " onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n";
writeSearchCategories(t);
t << "</div>\n"; t << "</div>\n";
t << "\n"; t << "\n";
t << "<!-- iframe showing the search results (closed by default) -->\n"; t << "<!-- iframe showing the search results (closed by default) -->\n";
......
...@@ -2375,7 +2375,7 @@ void MarkdownFileParser::parseInput(const char *fileName, ...@@ -2375,7 +2375,7 @@ void MarkdownFileParser::parseInput(const char *fileName,
Doxygen::markdownSupport = TRUE; Doxygen::markdownSupport = TRUE;
bool needsEntry = FALSE; bool needsEntry = FALSE;
Protection prot; Protection prot=Public;
while (parseCommentBlock( while (parseCommentBlock(
this, this,
current, current,
......
...@@ -738,7 +738,7 @@ MemberDef::MemberDef(const char *df,int dl,int dc, ...@@ -738,7 +738,7 @@ MemberDef::MemberDef(const char *df,int dl,int dc,
const char *t,const char *na,const char *a,const char *e, const char *t,const char *na,const char *a,const char *e,
Protection p,Specifier v,bool s,Relationship r,MemberType mt, Protection p,Specifier v,bool s,Relationship r,MemberType mt,
const ArgumentList *tal,const ArgumentList *al const ArgumentList *tal,const ArgumentList *al
) : Definition(df,dl,dc,removeRedundantWhiteSpace(na)) ) : Definition(df,dl,dc,removeRedundantWhiteSpace(na)), visited(FALSE)
{ {
//printf("MemberDef::MemberDef(%s)\n",na); //printf("MemberDef::MemberDef(%s)\n",na);
m_impl = new MemberDefImpl; m_impl = new MemberDefImpl;
...@@ -748,7 +748,7 @@ MemberDef::MemberDef(const char *df,int dl,int dc, ...@@ -748,7 +748,7 @@ MemberDef::MemberDef(const char *df,int dl,int dc,
m_isDestructorCached = 0; m_isDestructorCached = 0;
} }
MemberDef::MemberDef(const MemberDef &md) : Definition(md) MemberDef::MemberDef(const MemberDef &md) : Definition(md), visited(FALSE)
{ {
m_impl = new MemberDefImpl; m_impl = new MemberDefImpl;
m_isLinkableCached = 0; m_isLinkableCached = 0;
......
...@@ -33,16 +33,35 @@ ...@@ -33,16 +33,35 @@
#include "config.h" #include "config.h"
#include "docparser.h" #include "docparser.h"
MemberList::MemberList() MemberList::MemberList() : m_listType(MemberListType_pubMethods)
{ {
memberGroupList=0; memberGroupList=0;
m_varCnt=0;
m_funcCnt=0;
m_enumCnt=0;
m_enumValCnt=0;
m_typeCnt=0;
m_protoCnt=0;
m_defCnt=0;
m_friendCnt=0;
m_numDecMembers=-1; // special value indicating that value needs to be computed m_numDecMembers=-1; // special value indicating that value needs to be computed
m_numDocMembers=-1; // special value indicating that value needs to be computed m_numDocMembers=-1; // special value indicating that value needs to be computed
m_inGroup=FALSE;
m_inFile=FALSE;
m_needsSorting=FALSE;
} }
MemberList::MemberList(MemberListType lt) : m_listType(lt) MemberList::MemberList(MemberListType lt) : m_listType(lt)
{ {
memberGroupList=0; memberGroupList=0;
m_varCnt=0;
m_funcCnt=0;
m_enumCnt=0;
m_enumValCnt=0;
m_typeCnt=0;
m_protoCnt=0;
m_defCnt=0;
m_friendCnt=0;
m_numDecMembers=-1; // special value indicating that value needs to be computed m_numDecMembers=-1; // special value indicating that value needs to be computed
m_numDocMembers=-1; // special value indicating that value needs to be computed m_numDocMembers=-1; // special value indicating that value needs to be computed
m_inGroup=FALSE; m_inGroup=FALSE;
......
...@@ -152,15 +152,16 @@ static void format_warn(const char *file,int line,const char *text) ...@@ -152,15 +152,16 @@ static void format_warn(const char *file,int line,const char *text)
static void do_warn(const char *tag, const char *file, int line, const char *prefix, const char *fmt, va_list args) static void do_warn(const char *tag, const char *file, int line, const char *prefix, const char *fmt, va_list args)
{ {
if (!Config_getBool(tag)) return; // warning type disabled if (!Config_getBool(tag)) return; // warning type disabled
char text[40960]; const int bufSize = 40960;
char text[bufSize];
int l=0; int l=0;
if (prefix) if (prefix)
{ {
strcpy(text,prefix); qstrncpy(text,prefix,bufSize);
l=strlen(prefix); l=strlen(prefix);
} }
vsnprintf(text+l, 40960-l, fmt, args); vsnprintf(text+l, bufSize-l, fmt, args);
text[40960-1]='\0'; text[bufSize-1]='\0';
format_warn(file,line,text); format_warn(file,line,text);
} }
......
...@@ -71,8 +71,8 @@ struct CondCtx ...@@ -71,8 +71,8 @@ struct CondCtx
struct FileState struct FileState
{ {
FileState(int size) : fileBuf(size), FileState(int size) : lineNr(1), fileBuf(size),
oldFileBuf(0), oldFileBufPos(0) {} oldFileBuf(0), oldFileBufPos(0), bufState(0) {}
int lineNr; int lineNr;
BufStr fileBuf; BufStr fileBuf;
BufStr *oldFileBuf; BufStr *oldFileBuf;
......
...@@ -1354,26 +1354,6 @@ void writeJavascriptSearchIndex() ...@@ -1354,26 +1354,6 @@ void writeJavascriptSearchIndex()
Doxygen::indexList->addStyleSheetFile("search/search.js"); Doxygen::indexList->addStyleSheetFile("search/search.js");
} }
void writeSearchCategories(FTextStream &t)
{
#if 0
static SearchIndexCategoryMapping map;
int i,j=0;
for (i=0;i<NUM_SEARCH_INDICES;i++)
{
if (g_searchIndexCount[i]>0)
{
t << "<a class=\"SelectItem\" href=\"javascript:void(0)\" "
<< "onclick=\"searchBox.OnSelectItem(" << j << ")\">"
<< "<span class=\"SelectionMark\">&#160;</span>"
<< convertToXML(map.categoryLabel[i])
<< "</a>";
j++;
}
}
#endif
}
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
void initSearchIndexer() void initSearchIndexer()
......
...@@ -110,6 +110,5 @@ class SearchIndexExternal : public SearchIndexIntf ...@@ -110,6 +110,5 @@ class SearchIndexExternal : public SearchIndexIntf
//------- client side search index ---------------------- //------- client side search index ----------------------
void writeJavascriptSearchIndex(); void writeJavascriptSearchIndex();
void writeSearchCategories(FTextStream &t);
#endif #endif
...@@ -382,9 +382,9 @@ int Store::read(char *buf,uint size) ...@@ -382,9 +382,9 @@ int Store::read(char *buf,uint size)
void Store::printFreeList() void Store::printFreeList()
{ {
printf("FreeList: "); printf("FreeList: ");
portable_off_t pos = m_head->pos; while (m_head)
while (pos)
{ {
portable_off_t pos = m_head->pos;
printf("%x ",(int)pos); printf("%x ",(int)pos);
m_head = m_head->next; m_head = m_head->next;
} }
......
...@@ -251,6 +251,18 @@ class TagFileParser : public QXmlDefaultHandler ...@@ -251,6 +251,18 @@ class TagFileParser : public QXmlDefaultHandler
{ {
m_startElementHandlers.setAutoDelete(TRUE); m_startElementHandlers.setAutoDelete(TRUE);
m_endElementHandlers.setAutoDelete(TRUE); m_endElementHandlers.setAutoDelete(TRUE);
m_curClass=0;
m_curFile=0;
m_curNamespace=0;
m_curPackage=0;
m_curGroup=0;
m_curPage=0;
m_curDir=0;
m_curMember=0;
m_curEnumValue=0;
m_curIncludes=0;
m_state = Invalid;
m_locator = 0;
} }
void setDocumentLocator ( QXmlLocator * locator ) void setDocumentLocator ( QXmlLocator * locator )
......
This diff is collapsed.
...@@ -943,9 +943,9 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2 ...@@ -943,9 +943,9 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
* be followed by a single name or by a list of names * be followed by a single name or by a list of names
* of the category. * of the category.
*/ */
virtual QCString trMember(bool first_capital, bool singular) virtual QCString trMember(bool, bool singular)
{ {
QCString result((first_capital ? "član" : "član")); QCString result("član");
if (!singular) result+="ovi"; if (!singular) result+="ovi";
return result; return result;
} }
......
...@@ -3700,7 +3700,7 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl,bool forceNameOverwr ...@@ -3700,7 +3700,7 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl,bool forceNameOverwr
ArgumentListIterator srcAli(*srcAl),dstAli(*dstAl); ArgumentListIterator srcAli(*srcAl),dstAli(*dstAl);
Argument *srcA,*dstA; Argument *srcA,*dstA;
for (;(srcA=srcAli.current(),dstA=dstAli.current());++srcAli,++dstAli) for (;(srcA=srcAli.current()) && (dstA=dstAli.current());++srcAli,++dstAli)
{ {
if (srcA->defval.isEmpty() && !dstA->defval.isEmpty()) if (srcA->defval.isEmpty() && !dstA->defval.isEmpty())
{ {
......
...@@ -224,9 +224,8 @@ class XMLCodeGenerator : public CodeOutputInterface ...@@ -224,9 +224,8 @@ class XMLCodeGenerator : public CodeOutputInterface
{ {
public: public:
XMLCodeGenerator(FTextStream &t) : m_t(t), m_lineNumber(-1), XMLCodeGenerator(FTextStream &t) : m_t(t), m_lineNumber(-1), m_isMemberRef(FALSE), m_col(0),
m_insideCodeLine(FALSE), m_normalHLNeedStartTag(TRUE), m_insideCodeLine(FALSE), m_normalHLNeedStartTag(TRUE), m_insideSpecialHL(FALSE) {}
m_insideSpecialHL(FALSE) {}
virtual ~XMLCodeGenerator() { } virtual ~XMLCodeGenerator() { }
void codify(const char *text) void codify(const char *text)
...@@ -237,7 +236,7 @@ class XMLCodeGenerator : public CodeOutputInterface ...@@ -237,7 +236,7 @@ class XMLCodeGenerator : public CodeOutputInterface
m_t << "<highlight class=\"normal\">"; m_t << "<highlight class=\"normal\">";
m_normalHLNeedStartTag=FALSE; m_normalHLNeedStartTag=FALSE;
} }
writeXMLCodeString(m_t,text,col); writeXMLCodeString(m_t,text,m_col);
} }
void writeCodeLink(const char *ref,const char *file, void writeCodeLink(const char *ref,const char *file,
const char *anchor,const char *name, const char *anchor,const char *name,
...@@ -250,7 +249,7 @@ class XMLCodeGenerator : public CodeOutputInterface ...@@ -250,7 +249,7 @@ class XMLCodeGenerator : public CodeOutputInterface
m_normalHLNeedStartTag=FALSE; m_normalHLNeedStartTag=FALSE;
} }
writeXMLLink(m_t,ref,file,anchor,name,tooltip); writeXMLLink(m_t,ref,file,anchor,name,tooltip);
col+=qstrlen(name); m_col+=qstrlen(name);
} }
void writeTooltip(const char *, const DocLinkInfo &, const char *, void writeTooltip(const char *, const DocLinkInfo &, const char *,
const char *, const SourceLinkInfo &, const SourceLinkInfo & const char *, const SourceLinkInfo &, const SourceLinkInfo &
...@@ -284,7 +283,7 @@ class XMLCodeGenerator : public CodeOutputInterface ...@@ -284,7 +283,7 @@ class XMLCodeGenerator : public CodeOutputInterface
} }
m_t << ">"; m_t << ">";
m_insideCodeLine=TRUE; m_insideCodeLine=TRUE;
col=0; m_col=0;
} }
void endCodeLine() void endCodeLine()
{ {
...@@ -354,7 +353,7 @@ class XMLCodeGenerator : public CodeOutputInterface ...@@ -354,7 +353,7 @@ class XMLCodeGenerator : public CodeOutputInterface
QCString m_external; QCString m_external;
int m_lineNumber; int m_lineNumber;
bool m_isMemberRef; bool m_isMemberRef;
int col; int m_col;
bool m_insideCodeLine; bool m_insideCodeLine;
bool m_normalHLNeedStartTag; bool m_normalHLNeedStartTag;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment