diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cite.cpp | 4 | ||||
-rw-r--r-- | src/commentcnv.l | 8 | ||||
-rw-r--r-- | src/commentscan.l | 63 | ||||
-rw-r--r-- | src/config.xml | 9 | ||||
-rw-r--r-- | src/defargs.l | 8 | ||||
-rw-r--r-- | src/docparser.cpp | 57 | ||||
-rw-r--r-- | src/docparser.h | 40 | ||||
-rw-r--r-- | src/doctokenizer.l | 28 | ||||
-rw-r--r-- | src/doxygen.cpp | 24 | ||||
-rw-r--r-- | src/formula.cpp | 2 | ||||
-rw-r--r-- | src/htags.cpp | 2 | ||||
-rw-r--r-- | src/htmldocvisitor.cpp | 25 | ||||
-rw-r--r-- | src/htmlgen.cpp | 5 | ||||
-rw-r--r-- | src/index.h | 1 | ||||
-rw-r--r-- | src/latexdocvisitor.cpp | 100 | ||||
-rw-r--r-- | src/latexdocvisitor.h | 4 | ||||
-rw-r--r-- | src/latexgen.cpp | 13 | ||||
-rw-r--r-- | src/printdocvisitor.h | 5 | ||||
-rw-r--r-- | src/pyscanner.l | 10 | ||||
-rw-r--r-- | src/rtfgen.cpp | 31 | ||||
-rw-r--r-- | src/scanner.l | 3 | ||||
-rw-r--r-- | src/section.h | 3 | ||||
-rw-r--r-- | src/translator_cn.h | 117 | ||||
-rw-r--r-- | src/translator_it.h | 133 | ||||
-rw-r--r-- | src/util.cpp | 33 |
25 files changed, 591 insertions, 137 deletions
diff --git a/src/cite.cpp b/src/cite.cpp index 2ea6300..3125f35 100644 --- a/src/cite.cpp +++ b/src/cite.cpp @@ -226,13 +226,13 @@ void CiteDict::generatePage() const else if (insideBib) doc+=line+"\n"; int i; // determine text to use at the location of the @cite command - if (insideBib && (i=line.find("<a name=\"CITEREF_"))!=-1) + if (insideBib && (i=line.find("name=\"CITEREF_"))!=-1) { int j=line.find("\">["); int k=line.find("]</a>"); if (j!=-1 && k!=-1) { - QCString label = line.mid(i+17,j-i-17); + QCString label = line.mid(i+14,j-i-14); QCString number = line.mid(j+2,k-j-1); CiteInfo *ci = m_entries.find(label); //printf("label='%s' number='%s' => %p\n",label.data(),number.data(),ci); diff --git a/src/commentcnv.l b/src/commentcnv.l index 8823b68..8762b6a 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -704,6 +704,14 @@ void replaceComment(int offset); g_readLineCtx=YY_START; BEGIN(ReadLine); } +<SComment>\n[ \t]*"//"[\/!]("<")?[ \t]*[\\@]"}".*\n { + /* See Bug 752712: end the multiline comment when finding a @} or \} command */ + copyToOutput(" */",3); + copyToOutput(yytext,(int)yyleng); + g_inSpecialComment=FALSE; + g_inRoseComment=FALSE; + BEGIN(Scan); + } <SComment>\n[ \t]*"///"[^\/\n]/.*\n { replaceComment(1); g_readLineCtx=YY_START; diff --git a/src/commentscan.l b/src/commentscan.l index 3546277..9442ae3 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -834,6 +834,29 @@ static inline void setOutput(OutputContext ctx) } } + +static void addAnchor(const char *anchor) +{ + SectionInfo *si = Doxygen::sectionDict->find(anchor); + if (si) + { + if (si->lineNr != -1) + { + warn(yyFileName,yyLineNr,"multiple use of section label '%s' while adding anchor, (first occurrence: %s, line %d)",anchor,si->fileName.data(),si->lineNr); + } + else + { + warn(yyFileName,yyLineNr,"multiple use of section label '%s' while adding anchor, (first occurrence: %s)",anchor,si->fileName.data()); + } + } + else + { + si = new SectionInfo(yyFileName,yyLineNr,anchor,0,SectionInfo::Anchor,0); + Doxygen::sectionDict->append(anchor,si); + current->anchors->append(si); + } +} + // add a string to the output static inline void addOutput(const char *s) { @@ -905,6 +928,7 @@ IMG [iI][mM][gG] HR [hH][rR] PARA [pP][aA][rR][aA] CODE [cC][oO][dD][eE] +CAPTION [cC][aA][pP][tT][iI][oO][nN] DETAILEDHTML {PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA} DETAILEDHTMLOPT {CODE} BN [ \t\n\r] @@ -920,7 +944,7 @@ FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+@&#] FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"") ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]* LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]* -CITESCHAR [a-z_A-Z\x80-\xFF] +CITESCHAR [a-z_A-Z0-9\x80-\xFF] CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/]* CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)* SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?) @@ -1053,6 +1077,24 @@ RCSTAG "$"{ID}":"[^\n$]+"$" <Comment>"</remarks>" { // end of a brief or detailed description addOutput(yytext); } +<Comment>"<"{CAPTION}{ATTR}">" { + QCString tag=yytext; + int s=tag.find("id="); + if (s!=-1) // command has id attribute + { + char c=tag[s+3]; + if (c=='\'' || c=='"') // valid start + { + int e=tag.find(c,s+4); + if (e!=-1) // found matching end + { + QCString id=tag.mid(s+4,e-s-4); // extract id + addAnchor(id); + } + } + } + addOutput(yytext); + } <Comment>"<"{PRE}{ATTR}">" { insidePre=TRUE; addOutput(yytext); @@ -1745,24 +1787,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" /* ----- handle arguments of the anchor command ------- */ <AnchorLabel>{LABELID} { // found argument - SectionInfo *si = Doxygen::sectionDict->find(yytext); - if (si) - { - if (si->lineNr != -1) - { - warn(yyFileName,yyLineNr,"multiple use of section label '%s' while adding anchor, (first occurrence: %s, line %d)",yytext,si->fileName.data(),si->lineNr); - } - else - { - warn(yyFileName,yyLineNr,"multiple use of section label '%s' while adding anchor, (first occurrence: %s)",yytext,si->fileName.data()); - } - } - else - { - si = new SectionInfo(yyFileName,yyLineNr,yytext,0,SectionInfo::Anchor,0); - Doxygen::sectionDict->append(yytext,si); - current->anchors->append(si); - } + addAnchor(yytext); addOutput(yytext); BEGIN( Comment ); } diff --git a/src/config.xml b/src/config.xml index d7cd1f2..acbee8e 100644 --- a/src/config.xml +++ b/src/config.xml @@ -679,6 +679,15 @@ Go to the <a href="commands.html">next</a> section or return to the ]]> </docs> </option> + <option type='bool' id='GROUP_NESTED_COMPOUNDS' defval='0'> + <docs> +<![CDATA[ + If one adds a struct or class to a group and this option is enabled, then also + any nested class or struct is added to the same group. By default this option + is disabled and one has to add nested compounds explicitly via \ref cmdingroup "\\ingroup". +]]> + </docs> + </option> <option type='bool' id='SUBGROUPING' defval='1'> <docs> <![CDATA[ diff --git a/src/defargs.l b/src/defargs.l index e0b30fa..9032d8e 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -370,10 +370,10 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" if (a->type.left(6)=="const ") sv=6; else if (a->type.left(9)=="volatile ") sv=9; - if (a->type.mid(sv,6)=="struct" || - a->type.mid(sv,5)=="union" || - a->type.mid(sv,5)=="class" || - a->type.mid(sv,8)=="typename" || + if (a->type.mid(sv)=="struct" || + a->type.mid(sv)=="union" || + a->type.mid(sv)=="class" || + a->type.mid(sv)=="typename" || a->type=="const" || a->type=="volatile" ) diff --git a/src/docparser.cpp b/src/docparser.cpp index 0613ccf..d1362f0 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -2429,7 +2429,7 @@ void DocInternalRef::parse() //--------------------------------------------------------------------------- DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) : - m_refToSection(FALSE), m_refToAnchor(FALSE), m_isSubPage(FALSE) + m_refType(Unknown), m_isSubPage(FALSE) { m_parent = parent; Definition *compound = 0; @@ -2455,8 +2455,18 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) : m_ref = sec->ref; m_file = stripKnownExtensions(sec->fileName); - m_refToAnchor = sec->type==SectionInfo::Anchor; - m_refToSection = sec->type!=SectionInfo::Anchor; + if (sec->type==SectionInfo::Anchor) + { + m_refType = Anchor; + } + else if (sec->type==SectionInfo::Table) + { + m_refType = Table; + } + else + { + m_refType = Section; + } m_isSubPage = pd && pd->hasParentPage(); if (sec->type!=SectionInfo::Page || m_isSubPage) m_anchor = sec->label; //printf("m_text=%s,m_ref=%s,m_file=%s,m_refToAnchor=%d type=%d\n", @@ -3250,6 +3260,41 @@ endindexentry: //--------------------------------------------------------------------------- +DocHtmlCaption::DocHtmlCaption(DocNode *parent,const HtmlAttribList &attribs) +{ + m_hasCaptionId = FALSE; + HtmlAttribListIterator li(attribs); + HtmlAttrib *opt; + for (li.toFirst();(opt=li.current());++li) + { + if (opt->name=="id") // interpret id attribute as an anchor + { + SectionInfo *sec = Doxygen::sectionDict->find(opt->value); + if (sec) + { + //printf("Found anchor %s\n",id.data()); + m_file = sec->fileName; + m_anchor = sec->label; + m_hasCaptionId = TRUE; + if (g_sectionDict && g_sectionDict->find(opt->value)==0) + { + //printf("Inserting in dictionary!\n"); + g_sectionDict->append(opt->value,sec); + } + } + else + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid caption id `%s'",qPrint(opt->value)); + } + } + else // copy attribute + { + m_attribs.append(new HtmlAttrib(*opt)); + } + } + m_parent = parent; +} + int DocHtmlCaption::parse() { int retval=0; @@ -3755,12 +3800,14 @@ void DocHtmlTable::accept(DocVisitor *v) { v->visitPre(this); // for HTML output we put the caption first - if (m_caption && v->id()==DocVisitor_Html) m_caption->accept(v); + //if (m_caption && v->id()==DocVisitor_Html) m_caption->accept(v); + // doxygen 1.8.11: always put the caption first + if (m_caption) m_caption->accept(v); QListIterator<DocNode> cli(m_children); DocNode *n; for (cli.toFirst();(n=cli.current());++cli) n->accept(v); // for other output formats we put the caption last - if (m_caption && v->id()!=DocVisitor_Html) m_caption->accept(v); + //if (m_caption && v->id()!=DocVisitor_Html) m_caption->accept(v); v->visitPost(this); } diff --git a/src/docparser.h b/src/docparser.h index 1abb687..fcd18a4 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -822,15 +822,16 @@ class DocRef : public CompAccept<DocRef>, public DocNode QCString anchor() const { return m_anchor; } QCString targetTitle() const { return m_text; } bool hasLinkText() const { return !m_children.isEmpty(); } - bool refToAnchor() const { return m_refToAnchor; } - bool refToSection() const { return m_refToSection; } + bool refToAnchor() const { return m_refType==Anchor; } + bool refToSection() const { return m_refType==Section; } + bool refToTable() const { return m_refType==Table; } bool isSubPage() const { return m_isSubPage; } void accept(DocVisitor *v) { CompAccept<DocRef>::accept(this,v); } private: - bool m_refToSection; - bool m_refToAnchor; - bool m_isSubPage; + enum RefType { Unknown, Anchor, Section, Table }; + RefType m_refType; + bool m_isSubPage; QCString m_file; QCString m_relPath; QCString m_ref; @@ -1279,15 +1280,20 @@ class DocHtmlCell : public CompAccept<DocHtmlCell>, public DocNode class DocHtmlCaption : public CompAccept<DocHtmlCaption>, public DocNode { public: - DocHtmlCaption(DocNode *parent,const HtmlAttribList &attribs) : - m_attribs(attribs) { m_parent = parent; } + DocHtmlCaption(DocNode *parent,const HtmlAttribList &attribs); Kind kind() const { return Kind_HtmlCaption; } void accept(DocVisitor *v) { CompAccept<DocHtmlCaption>::accept(this,v); } const HtmlAttribList &attribs() const { return m_attribs; } int parse(); + bool hasCaptionId() const { return m_hasCaptionId; } + QCString file() const { return m_file; } + QCString anchor() const { return m_anchor; } private: HtmlAttribList m_attribs; + bool m_hasCaptionId; + QCString m_file; + QCString m_anchor; }; /** Node representing a HTML table row */ @@ -1303,8 +1309,18 @@ class DocHtmlRow : public CompAccept<DocHtmlRow>, public DocNode const HtmlAttribList &attribs() const { return m_attribs; } int parse(); int parseXml(bool header); - bool isHeading() const { return m_children.count()>0 && - ((DocHtmlCell*)m_children.getFirst())->isHeading(); + bool isHeading() const { // a row is a table heading if all cells are marked as such + bool heading=TRUE; + QListIterator<DocNode> it(m_children); + DocNode *n; + for (;(n=it.current());++it) + { + if (n->kind()==Kind_HtmlCell) + { + heading = heading && ((DocHtmlCell*)n)->isHeading(); + } + } + return m_children.count()>0 && heading; } void setVisibleCells(int n) { m_visibleCells = n; } int visibleCells() const { return m_visibleCells; } @@ -1332,6 +1348,12 @@ class DocHtmlTable : public CompAccept<DocHtmlTable>, public DocNode int parseXml(); uint numColumns() const { return m_numCols; } void accept(DocVisitor *v); + DocHtmlCaption *caption() const { return m_caption; } + DocHtmlRow *firstRow() const { + DocNode *n = m_children.getFirst(); + if (n && n->kind()==Kind_HtmlRow) return (DocHtmlRow*)n; + return 0; + } private: void computeTableGrid(); diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 31d583c..8c58fb5 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -169,8 +169,7 @@ static void processSection() if ((si=Doxygen::sectionDict->find(g_secLabel))) { si->fileName = file; - //si = new SectionInfo(file,g_secLabel,g_secTitle,g_secType); - //Doxygen::sectionDict.insert(g_secLabel,si); + si->type = g_secType; } } @@ -334,7 +333,7 @@ BLANK [ \t\r] ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]* LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]* PHPTYPE [\\:a-z_A-Z0-9\x80-\xFF\-]+ -CITESCHAR [a-z_A-Z\x80-\xFF] +CITESCHAR [a-z_A-Z0-9\x80-\xFF] CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/]* CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)* MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+ @@ -389,6 +388,7 @@ WORD1 {ESCWORD}|{CHARWORDQ}+|"{"|"}"|"'\"'"|("\""[^"\n]*\n?[^"\n]*"\"") WORD2 "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'" WORD1NQ {ESCWORD}|{CHARWORDQ}+|"{"|"}" WORD2NQ "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'" +CAPTION [cC][aA][pP][tT][iI][oO][nN] 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" @@ -1160,8 +1160,26 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} /* State for the pass used to find the anchors and sections */ -<St_Sections>[^\n@\\]+ -<St_Sections>"@@"|"\\\\" +<St_Sections>[^\n@\\<]+ +<St_Sections>"@@"|"\\\\"|"@<"|"\\<" +<St_Sections>"<"{CAPTION}({WS}+{ATTRIB})*">" { + QCString tag=yytext; + int s=tag.find("id="); + if (s!=-1) // command has id attribute + { + char c=tag[s+3]; + if (c=='\'' || c=='"') // valid start + { + int e=tag.find(c,s+4); + if (e!=-1) // found matching end + { + g_secType = SectionInfo::Table; + g_secLabel=tag.mid(s+4,e-s-4); // extract id + processSection(); + } + } + } + } <St_Sections>{CMD}"anchor"{BLANK}+ { g_secType = SectionInfo::Anchor; BEGIN(St_SecLabel1); diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 647b5c8..918cf82 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -11439,21 +11439,11 @@ void generateOutput() if (generateDocSet) Doxygen::indexList->addIndex(new DocSets); Doxygen::indexList->initialize(); HtmlGenerator::writeTabData(); - - // copy static stuff - copyStyleSheet(); - copyLogo(); - copyExtraFiles("HTML_EXTRA_FILES","HTML_OUTPUT"); - FTVHelp::generateTreeViewImages(); } if (generateLatex) { g_outputList->add(new LatexGenerator); LatexGenerator::init(); - - copyLatexStyleSheet(); - // copy static stuff - copyExtraFiles("LATEX_EXTRA_FILES","LATEX_OUTPUT"); } if (generateMan) { @@ -11675,6 +11665,20 @@ void generateOutput() g_s.end(); } + // copy static stuff + if (generateHtml) + { + FTVHelp::generateTreeViewImages(); + copyStyleSheet(); + copyLogo(); + copyExtraFiles("HTML_EXTRA_FILES","HTML_OUTPUT"); + } + if (generateLatex) + { + copyLatexStyleSheet(); + copyExtraFiles("LATEX_EXTRA_FILES","LATEX_OUTPUT"); + } + if (generateHtml && Config_getBool("GENERATE_HTMLHELP") && !Config_getString("HHC_LOCATION").isEmpty()) diff --git a/src/formula.cpp b/src/formula.cpp index ad37782..182ddaa 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -132,6 +132,7 @@ void FormulaList::generateBitmaps(const char *path) { err("Problems running dvips. Check your installation!\n"); portable_sysTimerStop(); + QDir::setCurrent(oldDir); return; } portable_sysTimerStop(); @@ -192,6 +193,7 @@ void FormulaList::generateBitmaps(const char *path) { err("Problem running ghostscript %s %s. Check your installation!\n",portable_ghostScriptCommand(),gsArgs); portable_sysTimerStop(); + QDir::setCurrent(oldDir); return; } portable_sysTimerStop(); diff --git a/src/htags.cpp b/src/htags.cpp index c910eb6..460d54d 100644 --- a/src/htags.cpp +++ b/src/htags.cpp @@ -59,7 +59,7 @@ bool Htags::execute(const QCString &htmldir) } else { - err("If you use USE_HTAGS then INPUT should specific a single directory. \n"); + err("If you use USE_HTAGS then INPUT should specify a single directory.\n"); return FALSE; } diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 99d6fdd..54dca32 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -1353,9 +1353,14 @@ void HtmlDocVisitor::visitPost(DocHtmlCell *c) void HtmlDocVisitor::visitPre(DocHtmlCaption *c) { if (m_hide) return; + if (c->hasCaptionId()) + { + m_t << "<a class=\"anchor\" id=\"" << c->anchor() << "\"></a>\n"; + } bool hasAlign = FALSE; HtmlAttribListIterator li(c->attribs()); HtmlAttrib *att; + QCString id; for (li.toFirst();(att=li.current());++li) { if (att->name=="align") hasAlign=TRUE; @@ -1902,24 +1907,8 @@ void HtmlDocVisitor::filterQuotedCdataAttr(const char* str) { case '&': m_t << "&"; break; case '"': m_t << """; break; - // For SGML compliance, and given the SGML declaration for HTML syntax, - // it's enough to replace these two, provided that the declaration - // for the HTML version we generate (and as supported by the browser) - // specifies that all the other symbols used in rawVal are - // within the right character class (i.e., they're not - // some multinational weird characters not in the BASESET). - // We assume that 1) the browser will support whatever is remaining - // in the formula and 2) the TeX formulae are generally governed - // by even stricter character restrictions so it should be enough. - // - // On some incompliant browsers, additional translation of - // '>' and '<' into ">" and "<", respectively, might be needed; - // but I'm unaware of particular modern (last 4 years) versions - // with such problems, so let's not do it for performance. - // Also, some brousers will (wrongly) not process the entity references - // inside the attribute value and show the &...; form instead, - // so we won't create entites unless necessary to minimize clutter there. - // --vassilii + case '<': m_t << "<"; break; + case '>': m_t << ">"; break; default: m_t << c; } } diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index a2dd473..dadbb4f 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1952,11 +1952,6 @@ static void endQuickIndexItem(FTextStream &t,const char *l) t << "</li>\n"; } -static QCString fixSpaces(const QCString &s) -{ - return substitute(s," "," "); -} - static bool quickLinkVisible(LayoutNavEntry::Kind kind) { static bool showFiles = Config_getBool("SHOW_FILES"); diff --git a/src/index.h b/src/index.h index 150d23f..ace3614 100644 --- a/src/index.h +++ b/src/index.h @@ -284,5 +284,6 @@ void initNamespaceMemberIndices(); void addClassMemberNameToIndex(MemberDef *md); void addFileMemberNameToIndex(MemberDef *md); void addNamespaceMemberNameToIndex(MemberDef *md); +QCString fixSpaces(const QCString &s); #endif diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 37c2130..22b3b32 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -171,9 +171,9 @@ QCString LatexDocVisitor::escapeMakeIndexChars(const char *s) 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_insideItem(FALSE), m_hide(FALSE), m_hideCaption(FALSE), m_insideTabbing(insideTabbing), m_insideTable(FALSE), m_langExt(langExt), m_currentColumn(0), - m_inRowspan(FALSE), m_inColspan(FALSE) + m_inRowspan(FALSE), m_inColspan(FALSE), m_firstRow(FALSE) { m_rowSpans.setAutoDelete(TRUE); } @@ -908,43 +908,65 @@ void LatexDocVisitor::visitPre(DocHtmlTable *t) if (m_hide) return; if (t->hasCaption()) { - m_t << "\\begin{table}[h]"; + DocHtmlCaption *c = t->caption(); + static bool pdfHyperLinks = Config_getBool("PDF_HYPERLINKS"); + if (!c->file().isEmpty() && pdfHyperLinks) + { + m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor() + << "}{}"; + } + m_t << endl; } + m_t << "\\begin{" << getTableName(t->parent()) << "}{" << t->numColumns() << "}\n"; + + if (t->hasCaption()) + { + DocHtmlCaption *c = t->caption(); + m_t << "\\caption{"; + visitCaption(this, c->children()); + m_t << "}"; + m_t << "\\label{" << stripPath(c->file()) << "_" << c->anchor() << "}"; + m_t << "\\\\\n"; + } + m_numCols = t->numColumns(); m_t << "\\hline\n"; + + // check if first row is a heading and then render the row already here + // and end it with \endfirsthead (triggered via m_firstRow==TRUE) + // then repeat the row as normal and end it with \endhead (m_firstRow==FALSE) + DocHtmlRow *firstRow = t->firstRow(); + if (firstRow && firstRow->isHeading()) + { + m_firstRow=TRUE; + firstRow->accept(this); + m_firstRow=FALSE; + } } void LatexDocVisitor::visitPost(DocHtmlTable *t) { m_insideTable=FALSE; if (m_hide) return; - if (t->hasCaption()) - { - m_t << "\\end{table}\n"; - } - else - { - m_t << "\\end{" << getTableName(t->parent()) << "}\n"; - } + m_t << "\\end{" << getTableName(t->parent()) << "}\n"; } void LatexDocVisitor::visitPre(DocHtmlCaption *c) { - if (m_hide) return; - m_t << "\\end{" << getTableName(c->parent()->parent()) << "}\n\\centering\n\\caption{"; + m_hideCaption = m_hide; + m_hide = TRUE; } -void LatexDocVisitor::visitPost(DocHtmlCaption *) +void LatexDocVisitor::visitPost(DocHtmlCaption *c) { - if (m_hide) return; - m_t << "}\n"; + m_hide = m_hideCaption; } void LatexDocVisitor::visitPre(DocHtmlRow *r) { m_currentColumn = 0; - if (r->isHeading()) m_t << "\\rowcolor{lightgray}"; + if (r->isHeading()) m_t << "\\rowcolor{\\tableheadbgcolor}"; } void LatexDocVisitor::visitPost(DocHtmlRow *row) @@ -1011,6 +1033,21 @@ void LatexDocVisitor::visitPost(DocHtmlRow *row) } m_t << "\n"; + + if (row->isHeading() && row->rowIndex()==1) + { + if (m_firstRow) + { + m_t << "\\endfirsthead" << endl; + m_t << "\\hline" << endl; + m_t << "\\endfoot" << endl; + m_t << "\\hline" << endl; + } + else + { + m_t << "\\endhead" << endl; + } + } } void LatexDocVisitor::visitPre(DocHtmlCell *c) @@ -1053,16 +1090,6 @@ void LatexDocVisitor::visitPre(DocHtmlCell *c) } } -#if 0 - QMap<int, int>::Iterator it = m_rowspanIndices.find(m_currentColumn); - if (it!=m_rowspanIndices.end() && it.data()>0) - { - m_t << "&"; - m_currentColumn++; - it++; - } -#endif - int cs = c->colSpan(); if (cs>1 && row) { @@ -1076,13 +1103,12 @@ void LatexDocVisitor::visitPre(DocHtmlCell *c) << m_numCols << "-\\arrayrulewidth*" << row->visibleCells() << ")*" << cs <<"/"<< m_numCols << "}|}{"; - if (c->isHeading()) m_t << "\\cellcolor{lightgray}"; + if (c->isHeading()) m_t << "\\cellcolor{\\tableheadbgcolor}"; } int rs = c->rowSpan(); if (rs>0) { m_inRowspan = TRUE; - //m_rowspanIndices[m_currentColumn] = rs; m_rowSpans.append(new ActiveRowSpan(c,rs,cs,m_currentColumn)); m_t << "\\multirow{" << rs << "}{\\linewidth}{"; } @@ -1258,7 +1284,7 @@ void LatexDocVisitor::visitPre(DocRef *ref) } else { - if (!ref->file().isEmpty()) startLink(ref->ref(),ref->file(),ref->anchor()); + if (!ref->file().isEmpty()) startLink(ref->ref(),ref->file(),ref->anchor(),ref->refToTable()); } if (!ref->hasLinkText()) filter(ref->targetTitle()); } @@ -1574,9 +1600,10 @@ void LatexDocVisitor::filter(const char *str) filterLatexString(m_t,str,m_insideTabbing,m_insidePre,m_insideItem); } -void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor) +void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,bool refToTable) { - if (ref.isEmpty() && Config_getBool("PDF_HYPERLINKS")) // internal PDF link + static bool pdfHyperLinks = Config_getBool("PDF_HYPERLINKS"); + if (ref.isEmpty() && pdfHyperLinks) // internal PDF link { m_t << "\\hyperlink{"; if (!file.isEmpty()) m_t << stripPath(file); @@ -1584,6 +1611,10 @@ void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const Q if (!anchor.isEmpty()) m_t << anchor; m_t << "}{"; } + else if (refToTable) + { + m_t << "\\doxytableref{"; + } else if (ref.isEmpty()) // internal non-PDF link { m_t << "\\doxyref{"; @@ -1597,9 +1628,10 @@ void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const Q void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor) { m_t << "}"; - if (ref.isEmpty() && !Config_getBool("PDF_HYPERLINKS")) + static bool pdfHyperLinks = Config_getBool("PDF_HYPERLINKS"); + if (ref.isEmpty() && !pdfHyperLinks) { - m_t << "{"; + m_t << "{"; filter(theTranslator->trPageAbbreviation()); m_t << "}{" << file; if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_"; diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h index d3aeaea..de797ae 100644 --- a/src/latexdocvisitor.h +++ b/src/latexdocvisitor.h @@ -159,7 +159,7 @@ class LatexDocVisitor : public DocVisitor void filter(const char *str); void startLink(const QCString &ref,const QCString &file, - const QCString &anchor); + const QCString &anchor,bool refToTable=FALSE); void endLink(const QCString &ref,const QCString &file, const QCString &anchor); QCString escapeMakeIndexChars(const char *s); @@ -190,6 +190,7 @@ class LatexDocVisitor : public DocVisitor bool m_insidePre; bool m_insideItem; bool m_hide; + bool m_hideCaption; bool m_insideTabbing; bool m_insideTable; int m_numCols; @@ -199,6 +200,7 @@ class LatexDocVisitor : public DocVisitor int m_currentColumn; bool m_inRowspan; bool m_inColspan; + bool m_firstRow; }; #endif diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 042dd7c..2ed30e9 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -455,9 +455,12 @@ static void writeDefaultHeaderPart1(FTextStream &t) "\\newcommand{\\clearemptydoublepage}{%\n" " \\newpage{\\pagestyle{empty}\\cleardoublepage}%\n" "}\n" - "\n" "\n"; + // caption style definition + t << "\\usepackage{caption}\n" + << "\\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top}\n\n"; + // End of preamble, now comes the document contents t << "%===== C O N T E N T S =====\n" "\n" @@ -1422,6 +1425,10 @@ void LatexGenerator::startDoxyAnchor(const char *fName,const char *, const char *anchor, const char *, const char *) { +} + +void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor) +{ static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS"); static bool usePDFLatex = Config_getBool("USE_PDFLATEX"); if (usePDFLatex && pdfHyperlinks) @@ -1431,10 +1438,6 @@ void LatexGenerator::startDoxyAnchor(const char *fName,const char *, if (anchor) t << "_" << anchor; t << "}{}"; } -} - -void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor) -{ t << "\\label{"; if (fName) t << stripPath(fName); if (anchor) t << "_" << anchor; diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h index 95e7e47..b86670a 100644 --- a/src/printdocvisitor.h +++ b/src/printdocvisitor.h @@ -536,10 +536,11 @@ class PrintDocVisitor : public DocVisitor indent_pre(); printf("<ref ref=\"%s\" file=\"%s\" " "anchor=\"%s\" targetTitle=\"%s\"" - " hasLinkText=\"%s\" refToAnchor=\"%s\" refToSection=\"%s\">\n", + " hasLinkText=\"%s\" refToAnchor=\"%s\" refToSection=\"%s\" refToTable=\"%s\">\n", ref->ref().data(),ref->file().data(),ref->anchor().data(), ref->targetTitle().data(),ref->hasLinkText()?"yes":"no", - ref->refToAnchor()?"yes":"no", ref->refToSection()?"yes":"no"); + ref->refToAnchor()?"yes":"no", ref->refToSection()?"yes":"no", + ref->refToTable()?"yes":"no"); } void visitPost(DocRef *) { diff --git a/src/pyscanner.l b/src/pyscanner.l index 8332a36..02d5b67 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -963,7 +963,9 @@ STARTDOCSYMS "##" { current->argList->getLast()->defval=g_defVal.stripWhiteSpace(); } - BEGIN(FunctionParams); + if (*yytext == ')') + current->args = argListToString(current->argList); + BEGIN(FunctionParams); } else // continue { @@ -1278,6 +1280,12 @@ STARTDOCSYMS "##" initTriSingleQuoteBlock(); BEGIN(TripleComment); } + "'" { + g_stringContext=YY_START; + current->initializer+="'"; + g_copyString=¤t->initializer; + BEGIN( SingleQuoteString ); + } "\"" { g_stringContext=YY_START; current->initializer+="\""; diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 7baaa3c..811efd8 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -541,6 +541,7 @@ void RTFGenerator::endIndexSection(IndexSections is) bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); static bool sourceBrowser = Config_getBool("SOURCE_BROWSER"); + static QCString projectName = Config_getString("PROJECT_NAME"); switch (is) { @@ -549,7 +550,7 @@ void RTFGenerator::endIndexSection(IndexSections is) // User has overridden document title in extensions file t << "}" << rtf_title; else - t << "}" << Config_getString("PROJECT_NAME"); + t << "}" << projectName; break; case isTitlePageAuthor: { @@ -578,7 +579,17 @@ void RTFGenerator::endIndexSection(IndexSections is) } t << rtf_Style_Reset << rtf_Style["Title"]->reference << endl; // set to title style - t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt TITLE}}\\par" << endl; + if (rtf_title) + // User has overridden document title in extensions file + t << "{\\field\\fldedit {\\*\\fldinst " << rtf_title << " \\\\*MERGEFORMAT}{\\fldrslt " << rtf_title << "}}\\par" << endl; + else + { + DocText *root = validatingParseText(projectName); + t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt "; + writeDoc(root,0,0); + t << "}}\\par" << endl; + + } t << rtf_Style_Reset << rtf_Style["SubTitle"]->reference << endl; // set to title style t << "\\par\n"; @@ -593,10 +604,14 @@ void RTFGenerator::endIndexSection(IndexSections is) t << "\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\n"; t << rtf_Style_Reset << rtf_Style["SubTitle"]->reference << endl; // set to subtitle style - t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt AUTHOR}}\\par" << endl; - t << "Version " << Config_getString("PROJECT_NUMBER") << "\\par"; + if (rtf_author) + t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt "<< rtf_author << " }}\\par" << endl; + else + t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt AUTHOR}}\\par" << endl; + + t << theTranslator->trVersion() << " " << Config_getString("PROJECT_NUMBER") << "\\par"; t << "{\\field\\fldedit {\\*\\fldinst CREATEDATE \\\\*MERGEFORMAT}" - "{\\fldrslt CREATEDATE}}\\par"<<endl; + "{\\fldrslt "<< dateToString(FALSE) << " }}\\par"<<endl; t << "\\page\\page"; DBG_RTF(t << "{\\comment End title page}" << endl) @@ -2363,7 +2378,7 @@ static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncl // files because the first line before the body // ALWAYS contains "{\comment begin body}" int len; - do + for(;;) { lineBuf.resize(maxLineLength); if ((len=f.readLine(lineBuf.rawData(),maxLineLength))==-1) @@ -2372,8 +2387,9 @@ static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncl return FALSE; } lineBuf.resize(len+1); + if (lineBuf.find("\\comment begin body")!=-1) break; if (bIncludeHeader) encodeForOutput(t,lineBuf.data()); - } while (lineBuf.find("\\comment begin body")==-1); + } lineBuf.resize(maxLineLength); @@ -2590,6 +2606,7 @@ bool RTFGenerator::preProcessFileInplace(const char *path,const char *name) if (!outf.open(IO_WriteOnly)) { err("Failed to open %s for writing!\n",combinedName.data()); + QDir::setCurrent(oldDir); return FALSE; } FTextStream outt(&outf); diff --git a/src/scanner.l b/src/scanner.l index 6fb4631..e9d5707 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -6748,7 +6748,8 @@ static void parseCompounds(Entry *rt) initEntry(); // deep copy group list from parent (see bug 727732) - if (rt->groups) + static bool autoGroupNested = Config_getBool("GROUP_NESTED_COMPOUNDS"); + if (autoGroupNested && rt->groups && ce->section!=Entry::ENUM_SEC && !(ce->spec&Entry::Enum)) { QListIterator<Grouping> gli(*rt->groups); Grouping *g; diff --git a/src/section.h b/src/section.h index 51668a2..b6268a9 100644 --- a/src/section.h +++ b/src/section.h @@ -31,7 +31,8 @@ struct SectionInfo Subsection = 2, Subsubsection = 3, Paragraph = 4, - Anchor = 5 + Anchor = 5, + Table = 6 }; SectionInfo(const char *f,const int lin,const char *l,const char *t, SectionType st,int lev,const char *r=0) : diff --git a/src/translator_cn.h b/src/translator_cn.h index 4d60e87..26160d4 100644 --- a/src/translator_cn.h +++ b/src/translator_cn.h @@ -24,7 +24,7 @@ */ #define CN_SPC " " -class TranslatorChinese : public TranslatorAdapter_1_8_2 +class TranslatorChinese : public Translator { public: /*! Used for identification of the language. The identification @@ -1794,6 +1794,121 @@ class TranslatorChinese : public TranslatorAdapter_1_8_2 { return "额外继承的成员函数"; } ////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////// +// new since 1.8.2 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a tooltip for the toggle button that appears in the + * navigation tree in the HTML output when GENERATE_TREEVIEW is + * enabled. This tooltip explains the meaning of the button. + */ + virtual QCString trPanelSynchronisationTooltip(bool enable) + { + QCString opt = enable ? "开启" : "关闭"; + return "点击"CN_SPC+opt+CN_SPC"面板同步"; + } + + /*! Used in a method of an Objective-C class that is declared in a + * a category. Note that the @1 marker is required and is replaced + * by a link. + */ + virtual QCString trProvidedByCategory() + { + return "由 category @1 提供."; + } + + /*! Used in a method of an Objective-C category that extends a class. + * Note that the @1 marker is required and is replaced by a link to + * the class method. + */ + virtual QCString trExtendsClass() + { + return "扩展类 @1."; + } + + /*! Used as the header of a list of class methods in Objective-C. + * These are similar to static public member functions in C++. + */ + virtual QCString trClassMethods() + { + return "类方法"; + } + + /*! Used as the header of a list of instance methods in Objective-C. + * These are similar to public member functions in C++. + */ + virtual QCString trInstanceMethods() + { + return "构造函数"; + } + + /*! Used as the header of the member functions of an Objective-C class. + */ + virtual QCString trMethodDocumentation() + { + return "函数文档"; + } + + /*! Used as the title of the design overview picture created for the + * VHDL output. + */ + virtual QCString trDesignOverview() + { + return "设计概要"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.8.4 +////////////////////////////////////////////////////////////////////////// + + /** old style UNO IDL services: implemented interfaces */ + virtual QCString trInterfaces() + { return "导出的接口"; } + + /** old style UNO IDL services: inherited services */ + virtual QCString trServices() + { return "包含的服务"; } + + /** UNO IDL constant groups */ + virtual QCString trConstantGroups() + { return "常量组"; } + + /** UNO IDL constant groups */ + virtual QCString trConstantGroupReference(const char *namespaceName) + { + QCString result=namespaceName; + result+= CN_SPC"常量组参考"; + return result; + } + /** UNO IDL service page title */ + virtual QCString trServiceReference(const char *sName) + { + QCString result=(QCString)sName; + result+= CN_SPC"服务参考"; + return result; + } + /** UNO IDL singleton page title */ + virtual QCString trSingletonReference(const char *sName) + { + QCString result=(QCString)sName; + result+= CN_SPC"单例参考"; + return result; + } + /** UNO IDL service page */ + virtual QCString trServiceGeneratedFromFiles(bool single) + { + // single is true implies a single file + return "该服务的文档由下列文件生成:"; + } + /** UNO IDL singleton page */ + virtual QCString trSingletonGeneratedFromFiles(bool single) + { + // single is true implies a single file + return "该单例的文档由下列文件生成:"; + } + +////////////////////////////////////////////////////////////////////////// }; #endif diff --git a/src/translator_it.h b/src/translator_it.h index c52aa50..d27c9dd 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -19,13 +19,17 @@ * * Revision history * + * 2015/07: updated translation of new items used since version 1.8.2 and 1.8.4 + * corrected a typo + * updated translator mail address * 2012/04: updated translation of new items used since version 1.7.5 and 1.8.0 * 2010/08: updated translation of new items used since version 1.6.0 and 1.6.3 * completely reviewed the translation in the trLegendDocs() function * corrected some typos all around * reviewed some translations all around * 2007/11: updated translation of new items used since version 1.5.4 - * 2007/10: Included corrections provided by Arialdo Martini <arialdomartini@bebox.it>, updated some strings marked with 'translate me' comment + * 2007/10: Included corrections provided by Arialdo Martini <arialdomartini@bebox.it> + * updated some strings marked with 'translate me' comment * 2006/10: made class to derive directly from Translator class (reported in Petr Prikryl October 9 translator report) * 2006/06: updated translation of new items used since version 1.4.6 * 2006/05: translated new items used since version 1.4.6 @@ -79,13 +83,13 @@ * tecnica (ad es. "lista dei file" e non "lista dei files") * * Se avete suggerimenti sulla traduzione di alcuni termini o volete segnalare - * eventuali sviste potete scrivermi all'indirizzo: alessandro@falappa.net + * eventuali sviste potete scrivermi all'indirizzo: alex.falappa@gmail.com */ #ifndef TRANSLATOR_IT_H #define TRANSLATOR_IT_H -class TranslatorItalian : public TranslatorAdapter_1_8_2 +class TranslatorItalian : public Translator { public: @@ -1832,7 +1836,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_2 /*! Used file list for a Java enum */ virtual QCString trEnumGeneratedFromFiles(bool single) - { QCString result = "La documentazione per questo tipo enumerato è stata generata"; + { QCString result = "La documentazione per questo tipo enumerato è stata generata a partire"; if (!single) result += " dai seguenti"; else result += " dal seguente"; result+=" file:"; @@ -1853,6 +1857,127 @@ class TranslatorItalian : public TranslatorAdapter_1_8_2 virtual QCString trAdditionalInheritedMembers() { return "Altri membri ereditati"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.8.2 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a tooltip for the toggle button that appears in the + * navigation tree in the HTML output when GENERATE_TREEVIEW is + * enabled. This tooltip explains the meaning of the button. + */ + virtual QCString trPanelSynchronisationTooltip(bool enable) + { + QCString opt = enable ? "abilitare" : "disabilitare"; + return "cliccare per "+opt+" la sincronizzazione del pannello"; + } + + /*! Used in a method of an Objective-C class that is declared in a + * a category. Note that the @1 marker is required and is replaced + * by a link. + */ + virtual QCString trProvidedByCategory() + { + return "Fornito dalla categoria @1."; + } + + /*! Used in a method of an Objective-C category that extends a class. + * Note that the @1 marker is required and is replaced by a link to + * the class method. + */ + virtual QCString trExtendsClass() + { + return "Estende la classe @1."; + } + + /*! Used as the header of a list of class methods in Objective-C. + * These are similar to static public member functions in C++. + */ + virtual QCString trClassMethods() + { + return "Metodi della classe"; + } + + /*! Used as the header of a list of instance methods in Objective-C. + * These are similar to public member functions in C++. + */ + virtual QCString trInstanceMethods() + { + return "Metodi di instanza"; + } + + /*! Used as the header of the member functions of an Objective-C class. + */ + virtual QCString trMethodDocumentation() + { + return "Documentazione dei metodi"; + } + + /*! Used as the title of the design overview picture created for the + * VHDL output. + */ + virtual QCString trDesignOverview() + { + return "Panoramica del progetto"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.8.4 +////////////////////////////////////////////////////////////////////////// + + /** old style UNO IDL services: implemented interfaces */ + virtual QCString trInterfaces() + { return "Interfacce esportate"; } + + /** old style UNO IDL services: inherited services */ + virtual QCString trServices() + { return "Servizi inclusi"; } + + /** UNO IDL constant groups */ + virtual QCString trConstantGroups() + { return "Gruppi di costanti"; } + + /** UNO IDL constant groups */ + virtual QCString trConstantGroupReference(const char *namespaceName) + { + QCString result="Riferimenti per il gruppo di costanti "; + result+=namespaceName; + return result; + } + /** UNO IDL service page title */ + virtual QCString trServiceReference(const char *sName) + { + QCString result=(QCString)"Riferimenti per il servizio "; + result+=sName; + return result; + } + /** UNO IDL singleton page title */ + virtual QCString trSingletonReference(const char *sName) + { + QCString result=(QCString)"Riferimenti per il singleton "; + result+=sName; + return result; + } + /** UNO IDL service page */ + virtual QCString trServiceGeneratedFromFiles(bool single) + { + // single is true implies a single file + QCString result=(QCString)"La documentazione per questo servizio " + "è stata generata a partire "; + if (single) result+="dal seguente file:"; else result+="dai seguenti file:"; + return result; + } + /** UNO IDL singleton page */ + virtual QCString trSingletonGeneratedFromFiles(bool single) + { + // single is true implies a single file + QCString result=(QCString)"La documentazione per questo singleton " + "è stata generata a partire "; + if (single) result+="dal seguente file:"; else result+="dai seguenti file:"; + return result; + } + +////////////////////////////////////////////////////////////////////////// + }; #endif diff --git a/src/util.cpp b/src/util.cpp index 3ee7ae5..db6a19c 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -18,6 +18,7 @@ #include <ctype.h> #include <errno.h> #include <math.h> +#include <limits.h> #include "md5.h" @@ -2472,6 +2473,35 @@ QCString fileToString(const char *name,bool filter,bool isSourceCode) QCString dateToString(bool includeTime) { QDateTime current = QDateTime::currentDateTime(); + QCString sourceDateEpoch = portable_getenv("SOURCE_DATE_EPOCH"); + if (!sourceDateEpoch.isEmpty()) + { + bool ok; + uint64 epoch = sourceDateEpoch.toUInt64(&ok); + if (!ok) + { + static bool warnedOnce=FALSE; + if (!warnedOnce) + { + warn_uncond("Environment variable SOURCE_DATE_EPOCH does not contain a valid number; value is '%s'\n", + sourceDateEpoch.data()); + warnedOnce=TRUE; + } + } + else if (epoch>UINT_MAX) + { + static bool warnedOnce=FALSE; + if (!warnedOnce) + { + warn_uncond("Environment variable SOURCE_DATA_EPOCH must have a value smaller than or equal to %llu; actual value %llu\n",UINT_MAX,epoch); + warnedOnce=TRUE; + } + } + else // all ok, replace current time with epoch value + { + current.setTime_t((ulong)epoch); // TODO: add support for 64bit epoch value + } + } return theTranslator->trDateTime(current.date().year(), current.date().month(), current.date().day(), @@ -6461,7 +6491,6 @@ void filterLatexString(FTextStream &t,const char *str, bool insideTabbing,bool insidePre,bool insideItem) { if (str==0) return; - //printf("filterLatexString(%s)\n",str); //if (strlen(str)<2) stackTrace(); const unsigned char *p=(const unsigned char *)str; const unsigned char *q; @@ -6555,7 +6584,7 @@ void filterLatexString(FTextStream &t,const char *str, default: //if (!insideTabbing && forceBreaks && c!=' ' && *p!=' ') if (!insideTabbing && - ((c>='A' && c<='Z' && pc!=' ' && pc!='\0') || (c==':' && pc!=':') || (pc=='.' && isId(c))) + ((c>='A' && c<='Z' && pc!=' ' && pc!='\0' && *p) || (c==':' && pc!=':') || (pc=='.' && isId(c))) ) { t << "\\+"; |