summaryrefslogtreecommitdiffstats
path: root/src/H5FAprivate.h
Commit message (Expand)AuthorAgeFilesLines
* Bring SWMR support in to the main development branch. (Finally!) More testsQuincey Koziol2016-12-021-0/+2
* [svn-r29659] Added fixed array chunk indexing from revise_chunks.Dana Robinson2016-04-071-0/+10
* [svn-r29548] Minor normalization w/ trunk in preparation for big merge.Dana Robinson2016-03-241-1/+1
* [svn-r28624] Minor normalization of H5FA package with revise_chunks.Dana Robinson2015-12-141-22/+23
* [svn-r18197] Description:Quincey Koziol2010-01-301-2/+2
* [svn-r17895] Description:Quincey Koziol2009-11-161-7/+4
* [svn-r17518] Description:Quincey Koziol2009-09-241-0/+2
* [svn-r17155] Description:Quincey Koziol2009-07-031-0/+132
mary='file diffstat' width='65%'> -rw-r--r--src/membergroup.cpp6
-rw-r--r--src/memberlist.cpp6
-rw-r--r--src/namespacedef.cpp6
-rw-r--r--src/outputlist.cpp4
-rw-r--r--src/outputlist.h2
-rw-r--r--src/rtfgen.cpp3
-rw-r--r--src/scanner.l18
-rw-r--r--src/tagreader.cpp1
-rw-r--r--src/translator_de.h57
-rw-r--r--src/util.cpp50
-rw-r--r--src/util.h13
-rw-r--r--src/xmlgen.cpp2
31 files changed, 317 insertions, 141 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index cb4f842..5c75ebb 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -301,6 +301,10 @@ QCString ClassDef::displayName() const
{
n="<"+n.left(n.length()-2)+">";
}
+ else if (n.right(2)=="-g")
+ {
+ n = n.left(n.length()-2);
+ }
//printf("ClassDef::displayName()=%s\n",n.data());
return n;
}
@@ -863,7 +867,7 @@ static void writeTemplateSpec(OutputList &ol,Definition *d,
void ClassDef::writeBriefDescription(OutputList &ol,bool exampleFlag)
{
- if (!briefDescription().isEmpty())
+ if (!briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
ol.startParagraph();
ol.parseDoc(briefFile(),briefLine(),this,0,
@@ -882,10 +886,6 @@ void ClassDef::writeBriefDescription(OutputList &ol,bool exampleFlag)
writeMoreLink(ol,anchor());
}
- //ol.pushGeneratorState();
- //ol.disable(OutputGenerator::RTF);
- //ol.newParagraph(); // FIXME:PARA
- //ol.popGeneratorState();
ol.endParagraph();
}
ol.writeSynopsis();
@@ -1937,9 +1937,9 @@ void ClassDef::writeDocumentation(OutputList &ol)
}
startTitle(ol,getOutputFileBase(),this);
- ol.parseText(pageTitle);
+ ol.parseText(pageTitle,TRUE);
addGroupListToTitle(ol,this);
- endTitle(ol,getOutputFileBase(),name());
+ endTitle(ol,getOutputFileBase(),displayName());
writeDocumentationContents(ol,pageTitle);
if (generateTreeView)
@@ -2073,7 +2073,7 @@ void ClassDef::writeMemberList(OutputList &ol)
ol.endQuickIndices();
}
startTitle(ol,0);
- ol.parseText(displayName()+" "+theTranslator->trMemberList());
+ ol.parseText(displayName()+" "+theTranslator->trMemberList(),TRUE);
endTitle(ol,0,0);
ol.startContents();
ol.parseText(theTranslator->trThisIsTheListOfAllMembers());
diff --git a/src/commentscan.l b/src/commentscan.l
index b95ae7c..61cc9e2 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -1040,7 +1040,11 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
addOutput(yytext);
}
<Comment>^{B}*"-" { // start of autolist
- setOutput(OutputDoc);
+ if (inContext!=OutputXRef)
+ {
+ briefEndsAtDot=FALSE;
+ setOutput(OutputDoc);
+ }
addOutput(yytext);
}
<Comment>("."+)[a-z_A-Z0-9\)] { // . at start or in the middle of a word, or ellipsis
@@ -2571,6 +2575,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
lineNr = yyLineNr;
//printf("position=%d parseMore=%d\n",position,parseMore);
+
return parseMore;
}
diff --git a/src/definition.h b/src/definition.h
index 5d7fd15..46b81a0 100644
--- a/src/definition.h
+++ b/src/definition.h
@@ -290,7 +290,7 @@ class Definition : public DefinitionIntf, public LockableObj
virtual void addInnerCompound(Definition *d);
virtual void setOuterScope(Definition *d);
- void setHidden(bool b);
+ virtual void setHidden(bool b);
void setArtificial(bool b);
diff --git a/src/dirdef.cpp b/src/dirdef.cpp
index 2d15f54..9e9579b 100644
--- a/src/dirdef.cpp
+++ b/src/dirdef.cpp
@@ -152,7 +152,7 @@ void DirDef::writeDetailedDescription(OutputList &ol,const QCString &title)
void DirDef::writeBriefDescription(OutputList &ol)
{
- if (!briefDescription().isEmpty())
+ if (!briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
ol.startParagraph();
ol.parseDoc(briefFile(),briefLine(),this,0,briefDescription(),TRUE,FALSE);
@@ -225,7 +225,6 @@ void DirDef::writeSubDirList(OutputList &ol)
}
if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
- ol.startParagraph();
ol.startMemberDescription();
ol.parseDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),
FALSE, // indexWords
@@ -235,7 +234,6 @@ void DirDef::writeSubDirList(OutputList &ol)
TRUE // link from index
);
ol.endMemberDescription();
- ol.endParagraph();
}
dd=m_subdirs.next();
}
@@ -288,7 +286,6 @@ void DirDef::writeFileList(OutputList &ol)
ol.endMemberItem();
if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
- ol.startParagraph();
ol.startMemberDescription();
ol.parseDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),
FALSE, // indexWords
@@ -298,7 +295,6 @@ void DirDef::writeFileList(OutputList &ol)
TRUE // link from index
);
ol.endMemberDescription();
- ol.endParagraph();
}
fd=m_fileList->next();
}
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 5028c90..d6f31df 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -6509,7 +6509,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine,
return root;
}
-DocNode *validatingParseText(const char *input)
+DocNode *validatingParseText(const char *input,bool forceBreaks)
{
// store parser state so we can re-enter this function if needed
docParserPushContext();
@@ -6537,7 +6537,7 @@ DocNode *validatingParseText(const char *input)
g_paramsFound.clear();
g_searchUrl="";
- DocText *txt = new DocText;
+ DocText *txt = new DocText(forceBreaks);
if (input)
{
diff --git a/src/docparser.h b/src/docparser.h
index 39f0fe5..6ad4457 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -69,7 +69,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine,
/*! Main entry point for parsing simple text fragments. These
* fragments are limited to words, whitespace and symbols.
*/
-DocNode *validatingParseText(const char *input);
+DocNode *validatingParseText(const char *input,bool forceBreaks=FALSE);
/*! Searches for section and anchor commands in the input */
void docFindSections(const char *input,
@@ -1195,10 +1195,14 @@ class DocHtmlTable : public CompAccept<DocHtmlTable>, public DocNode
class DocText : public CompAccept<DocText>, public DocNode
{
public:
- DocText() {}
+ DocText(bool forceBreaks) : m_forceBreaks(forceBreaks) {}
Kind kind() const { return Kind_Text; }
void accept(DocVisitor *v) { CompAccept<DocText>::accept(this,v); }
void parse();
+ bool forceBreaks() const { return m_forceBreaks; }
+
+ private:
+ bool m_forceBreaks;
};
/*! @brief Root node of documentation tree */
diff --git a/src/docsets.cpp b/src/docsets.cpp
index 1c0b55d..17f8ca8 100644
--- a/src/docsets.cpp
+++ b/src/docsets.cpp
@@ -135,7 +135,8 @@ void DocSets::initialize()
err("Could not open file %s for writing\n",notes.data());
exit(1);
}
- QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index";
+ //QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index";
+ QCString indexName="index";
m_nts.setDevice(m_nf);
m_nts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
m_nts << "<DocSetNodes version=\"1.0\">" << endl;
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index d33dc4a..1ede3b4 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -333,12 +333,12 @@ LNKWORD1 ("::"|"#")?{SCOPEMASK}
CVSPEC {BLANK}*("const"|"volatile")
LNKWORD2 (({SCOPEPRE}*"operator"{OPMASK})|({SCOPEPRE}"operator"{OPMASKOPT})|(("::"|"#"){SCOPEPRE}*"operator"{OPMASKOPT})){CVSPEC}?
LNKWORD3 ([0-9a-z_A-Z\-]+("/"|"\\"))*[0-9a-z_A-Z\-]+("."[0-9a-z_A-Z]+)+
-CHARWORDQ [^ \t\n\r\\@<>()\[\]:;\?{}&%$#,."]
+CHARWORDQ [^ \t\n\r\\@<>()\[\]:;\?{}&%$#,."=]
ESCWORD "%"{ID}(("::"|"."){ID})*
WORD1 {ESCWORD}|{CHARWORDQ}+|"{"|"}"|"'\"'"|("\""[^"\n]*\n?[^"\n]*"\"")
-WORD2 "."|","|"("|")"|"["|"]"|":"|";"|"\?"
+WORD2 "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="
WORD1NQ {ESCWORD}|{CHARWORDQ}+
-WORD2NQ "."|","|"("|")"|"["|"]"|":"|";"|"\?"
+WORD2NQ "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="
HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*{WS}*(("/")?)">"
HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"sup"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p"
HTMLKEYU "STRONG"|"CENTER"|"TABLE"|"CAPTION"|"SMALL"|"CODE"|"DFN"|"VAR"|"IMG"|"PRE"|"SUB"|"SUP"|"TR"|"TD"|"TH"|"OL"|"UL"|"LI"|"TT"|"KBD"|"EM"|"HR"|"DL"|"DT"|"DD"|"BR"|"I"|"A"|"B"|"P"
@@ -940,7 +940,7 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}
<*>\n {
warn(g_fileName,yylineno,"warning: Unexpected new line character");
}
-<*>[\\@<>&$#%~"] { /* unescaped special character */
+<*>[\\@<>&$#%~"=] { /* unescaped special character */
//warn(g_fileName,yylineno,"warning: Unexpected character `%s', assuming command \\%s was meant.",yytext,yytext);
g_token->name = yytext;
return TK_COMMAND;
diff --git a/src/dot.cpp b/src/dot.cpp
index 7a92eeb..744b95f 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -3579,7 +3579,7 @@ void writeDotImageMapFromFile(FTextStream &t,
else // bitmap graphics
{
t << "<img src=\"" << relPath << imgName << "\" alt=\""
- << imgName << "\" border=\"0\" usemap=\"#" << mapName << "\">" << endl
+ << imgName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>" << endl
<< "<map name=\"" << mapName << "\" id=\"" << mapName << "\">";
convertMapFile(t, absOutFile, relPath ,TRUE, context);
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 2ad5bc5..a451e46 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -2398,12 +2398,13 @@ static void addVariable(EntryNav *rootNav,int isFuncPtr=-1)
Debug::print(Debug::Variables,0,
"VARIABLE_SEC: \n"
- " type=`%s' name=`%s' args=`%s' bodyLine=`%d' mGrpId=%d\n",
+ " type=`%s' name=`%s' args=`%s' bodyLine=`%d' mGrpId=%d relates=%s\n",
root->type.data(),
root->name.data(),
root->args.data(),
root->bodyLine,
- root->mGrpId
+ root->mGrpId,
+ root->relates.data()
);
//printf("root->parent->name=%s\n",root->parent->name.data());
@@ -4355,8 +4356,8 @@ static bool findClassRelation(
else if (mode==Undocumented && (scopeOffset==0 || isATemplateArgument))
{
Debug::print(Debug::Classes,0,
- " New undocumented base class `%s' baseClassName=%s\n",
- biName.data(),baseClassName.data()
+ " New undocumented base class `%s' baseClassName=%s isArtificial=%d\n",
+ biName.data(),baseClassName.data(),isArtificial
);
baseClass=0;
if (isATemplateArgument)
@@ -5941,16 +5942,17 @@ static void findMember(EntryNav *rootNav,
{
bool newMember=TRUE; // assume we have a new member
bool newMemberName=FALSE;
+ MemberDef *mdDefine=0;
bool isDefine=FALSE;
{
MemberName *mn = Doxygen::functionNameSDict->find(funcName);
if (mn)
{
- MemberDef *md = mn->first();
- while (md && !isDefine)
+ mdDefine = mn->first();
+ while (mdDefine && !isDefine)
{
- isDefine = isDefine || md->isDefine();
- md = mn->next();
+ isDefine = isDefine || mdDefine->isDefine();
+ if (!isDefine) mdDefine = mn->next();
}
}
}
@@ -5970,6 +5972,7 @@ static void findMember(EntryNav *rootNav,
LockingPtr<ArgumentList> rmdAl = rmd->argumentList();
newMember=
+ className!=rmd->getOuterScope()->name() ||
!matchArguments2(rmd->getOuterScope(),rmd->getFileDef(),rmdAl.pointer(),
cd,fd,root->argList,
TRUE);
@@ -5997,19 +6000,17 @@ static void findMember(EntryNav *rootNav,
else
mtype=MemberDef::Function;
+ if (isDefine && mdDefine)
+ {
+ mdDefine->setHidden(TRUE);
+ funcType="#define";
+ funcArgs=mdDefine->argsString();
+ funcDecl=funcType + " " + funcName;
+ }
+
//printf("New related name `%s' `%d'\n",funcName.data(),
// root->argList ? (int)root->argList->count() : -1);
- // new related (member) function
-#if 0 // removed as it doesn't handle related template functions correctly
- ArgumentList *tArgList =
- getTemplateArgumentsFromName(scopeName+"::"+funcName,root->tArgLists);
- MemberDef *md=new MemberDef(
- root->fileName,root->startLine,
- funcType,funcName,funcArgs,exceptions,
- root->protection,root->virt,root->stat,TRUE,
- mtype,tArgList,funcArgs.isEmpty() ? 0 : root->argList);
-#endif
// first note that we pass:
// (root->tArgLists ? root->tArgLists->last() : 0)
// for the template arguments fo the new "member."
@@ -6025,6 +6026,12 @@ static void findMember(EntryNav *rootNav,
mtype,
(root->tArgLists ? root->tArgLists->last() : 0),
funcArgs.isEmpty() ? 0 : root->argList);
+
+ if (isDefine && mdDefine)
+ {
+ md->setInitializer(mdDefine->initializer());
+ }
+
//
// we still have the problem that
// MemberDef::writeDocumentation() in memberdef.cpp
@@ -6105,7 +6112,10 @@ static void findMember(EntryNav *rootNav,
cd->insertUsedFile(root->fileName);
md->setRefItems(root->sli);
if (root->relatesType == Duplicate) md->setRelatedAlso(cd);
- addMemberToGroups(root,md);
+ if (!isDefine)
+ {
+ addMemberToGroups(root,md);
+ }
//printf("Adding member=%s\n",md->name().data());
if (newMemberName)
{
@@ -7986,7 +7996,8 @@ static void buildPageList(EntryNav *rootNav)
QCString title=root->args.stripWhiteSpace();
if (title.isEmpty()) title=theTranslator->trMainPage();
- QCString name = Config_getBool("GENERATE_TREEVIEW")?"main":"index";
+ //QCString name = Config_getBool("GENERATE_TREEVIEW")?"main":"index";
+ QCString name = "index";
addRefItem(root->sli,
name,
"page",
@@ -8011,7 +8022,8 @@ static void findMainPage(EntryNav *rootNav)
{
//printf("Found main page! \n======\n%s\n=======\n",root->doc.data());
QCString title=root->args.stripWhiteSpace();
- QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index";
+ //QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index";
+ QCString indexName="index";
Doxygen::mainPage = new PageDef(root->fileName,root->startLine,
indexName, root->brief+root->doc+root->inbodyDocs,title);
//setFileNameForSections(root->anchors,"index",Doxygen::mainPage);
@@ -9918,7 +9930,7 @@ void searchInputFiles(StringList &inputFiles)
readFileOrDirectory(s,0,Doxygen::mscFileNameDict,0,0,
0,0,0,
alwaysRecursive);
- s=dotFileList.next();
+ s=mscFileList.next();
}
diff --git a/src/filedef.cpp b/src/filedef.cpp
index b3f19fa..5c68187 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -220,7 +220,7 @@ void FileDef::writeDetailedDescription(OutputList &ol,const QCString &title)
void FileDef::writeBriefDescription(OutputList &ol)
{
- if (!briefDescription().isEmpty())
+ if (!briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
ol.startParagraph();
ol.parseDoc(briefFile(),briefLine(),this,0,
@@ -531,7 +531,7 @@ void FileDef::writeDocumentation(OutputList &ol)
ol.parseText(pageTitleShort); // Html only
ol.enableAll();
ol.disable(OutputGenerator::Html);
- ol.parseText(pageTitle); // other output formats
+ ol.parseText(pageTitle,TRUE); // other output formats
ol.popGeneratorState();
addGroupListToTitle(ol,this);
endTitle(ol,getOutputFileBase(),title);
diff --git a/src/groupdef.cpp b/src/groupdef.cpp
index 82fd647..f4d4eb9 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -554,7 +554,7 @@ void GroupDef::writeDetailedDescription(OutputList &ol,const QCString &title)
void GroupDef::writeBriefDescription(OutputList &ol)
{
- if (!briefDescription().isEmpty())
+ if (!briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
ol.startParagraph();
ol.parseDoc(briefFile(),briefLine(),this,0,
@@ -574,11 +574,6 @@ void GroupDef::writeBriefDescription(OutputList &ol)
ol.endTextLink();
}
ol.popGeneratorState();
-
- //ol.pushGeneratorState();
- //ol.disable(OutputGenerator::RTF);
- //ol.newParagraph();
- //ol.popGeneratorState();
ol.endParagraph();
}
}
@@ -626,11 +621,9 @@ void GroupDef::writeFiles(OutputList &ol,const QCString &title)
ol.endMemberItem();
if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
- ol.startParagraph();
ol.startMemberDescription();
ol.parseDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),FALSE,FALSE);
ol.endMemberDescription();
- ol.endParagraph();
}
fd=fileList->next();
}
@@ -668,11 +661,9 @@ void GroupDef::writeNestedGroups(OutputList &ol,const QCString &title)
ol.endMemberItem();
if (!gd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
- ol.startParagraph();
ol.startMemberDescription();
ol.parseDoc(briefFile(),briefLine(),gd,0,gd->briefDescription(),FALSE,FALSE);
ol.endMemberDescription();
- ol.endParagraph();
}
gd=groupList->next();
}
@@ -703,11 +694,9 @@ void GroupDef::writeDirs(OutputList &ol,const QCString &title)
}
if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
- ol.startParagraph();
ol.startMemberDescription();
ol.parseDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),FALSE,FALSE);
ol.endMemberDescription();
- ol.endParagraph();
}
dd=dirList->next();
}
@@ -1276,7 +1265,9 @@ void addMemberToGroups(Entry *root,MemberDef *md)
if (insertit)
{
- //printf("insertMember found at %s line %d\n",md->getDefFileName().data(),md->getDefLine());
+ //printf("insertMember found at %s line %d: %s: related %s\n",
+ // md->getDefFileName().data(),md->getDefLine(),
+ // md->name().data(),root->relates.data());
bool success = fgd->insertMember(md);
if (success)
{
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp
index ebca041..f4e9c54 100644
--- a/src/htmlgen.cpp
+++ b/src/htmlgen.cpp
@@ -765,7 +765,10 @@ static void writeServerSearchBox(FTextStream &t,const char *relPath,bool highlig
static QCString getLogoName(const char *projectLogo)
{
if (projectLogo==0) return "";
- if (projectLogo[0]=='$') return projectLogo; // marker is used
+ if (projectLogo[0]=='$')
+ {
+ return projectLogo; // marker is used
+ }
QFileInfo fi(projectLogo);
if (fi.exists())
{
@@ -1017,8 +1020,8 @@ static QCString substituteHtmlKeywords(const QCString &s,const char *title,
// additional HTML only keywords
result = substitute(result,"$treeview",treeViewCssJs);
- result = substitute(result,"$search",searchCssJs);
result = substitute(result,"$searchbox",searchBox);
+ result = substitute(result,"$search",searchCssJs);
result = substitute(result,"$mathjax",mathJaxJs);
result = substitute(result,"$relpath$",relPath); //<-- must be last
@@ -1275,7 +1278,7 @@ void HtmlGenerator::writeHeaderFile(QFile &file, const char *cssname)
t << " <tbody>\n";
t << " <tr style=\"height: 56px;\">\n";
t << " <!--BEGIN PROJECT_LOGO-->\n";
- t << " <td id=\"projectlogo\"><img alt=\"Logo\" src=\"$relpath$$projectlogo\"></td>\n";
+ t << " <td id=\"projectlogo\"><img alt=\"Logo\" src=\"$relpath$$projectlogo\"/></td>\n";
t << " <!--END PROJECT_LOGO-->\n";
t << " <!--BEGIN PROJECT_NAME-->\n";
t << " <td style=\"padding-left: 0.5em;\">\n";
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 48e3675..6d53f37 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -46,6 +46,28 @@ static QCString escapeLabelName(const char *s)
return result;
}
+static bool isSymbol(const char *s)
+{
+ int l=0; // word length
+ int nCaps=0; // number of captials
+ int nCamels=0; // number of lowerCase+upperCase combos
+ int nUnscore=0; // number of underscores
+ const char *p=s;
+ char c;
+ bool plo=FALSE;
+ while ((c=*p++))
+ {
+ bool lo=c>='a' && c<='z';
+ bool up=c>='A' && c<='Z';
+ if (c=='_') nUnscore++;
+ if (up) nCaps++;
+ if (up && plo) nCamels++;
+ plo=lo;
+ l++;
+ }
+ return l>=20 || nCaps>=4 || nCamels>=2 || nUnscore>0;
+}
+
const int maxLevels=5;
static const char *secLabels[maxLevels] =
{ "section","subsection","subsubsection","paragraph","subparagraph" };
@@ -100,7 +122,8 @@ LatexDocVisitor::LatexDocVisitor(FTextStream &t,CodeOutputInterface &ci,
const char *langExt,bool insideTabbing)
: DocVisitor(DocVisitor_Latex), m_t(t), m_ci(ci), m_insidePre(FALSE),
m_insideItem(FALSE), m_hide(FALSE), m_insideTabbing(insideTabbing),
- m_langExt(langExt), m_currentColumn(0), m_inRowspan(FALSE)
+ m_forceBreaks(FALSE), m_langExt(langExt), m_currentColumn(0),
+ m_inRowspan(FALSE)
{
}
@@ -111,14 +134,14 @@ LatexDocVisitor::LatexDocVisitor(FTextStream &t,CodeOutputInterface &ci,
void LatexDocVisitor::visit(DocWord *w)
{
if (m_hide) return;
- filter(w->word());
+ filter(w->word(),isSymbol(w->word()));
}
void LatexDocVisitor::visit(DocLinkedWord *w)
{
if (m_hide) return;
startLink(w->ref(),w->file(),w->anchor());
- filter(w->word());
+ filter(w->word(),isSymbol(w->word()));
endLink(w->ref(),w->file(),w->anchor());
}
@@ -1301,17 +1324,18 @@ void LatexDocVisitor::visitPost(DocCopy *)
{
}
-void LatexDocVisitor::visitPre(DocText *)
+void LatexDocVisitor::visitPre(DocText *t)
{
+ m_forceBreaks = t->forceBreaks();
}
void LatexDocVisitor::visitPost(DocText *)
{
}
-void LatexDocVisitor::filter(const char *str)
+void LatexDocVisitor::filter(const char *str,bool forceBreaks)
{
- filterLatexString(m_t,str,m_insideTabbing,m_insidePre,m_insideItem);
+ filterLatexString(m_t,str,m_insideTabbing,m_insidePre,m_insideItem,m_forceBreaks || forceBreaks);
}
void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor)
diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h