Commit 223e7de6 authored by Dimitri van Heesch's avatar Dimitri van Heesch

various fixes and restructuring

parent 67e8d626
...@@ -2572,7 +2572,7 @@ class Receiver ...@@ -2572,7 +2572,7 @@ class Receiver
step before running doxygen, you can also add the name of the image file after \c \\startuml step before running doxygen, you can also add the name of the image file after \c \\startuml
and inside curly brackets, i.e. and inside curly brackets, i.e.
\verbatim \verbatim
@startuml{myimage.png} @startuml{myimage.png} "Image Caption" width=5cm
Alice -> Bob : Hello Alice -> Bob : Hello
@enduml @enduml
\endverbatim \endverbatim
...@@ -2897,15 +2897,16 @@ class Receiver ...@@ -2897,15 +2897,16 @@ class Receiver
specific, so if you want to insert an image for more than one specific, so if you want to insert an image for more than one
format you'll have to repeat this command for each format. format you'll have to repeat this command for each format.
The first argument specifies the output format. Currently, the The first argument specifies the output format in which the image should
following values are supported: \c html, \c latex, \c docbook and \c rtf. be embedded. Currently, the following values are supported:
\c html, \c latex, \c docbook and \c rtf.
The second argument specifies the file name of the image. The second argument specifies the file name of the image.
doxygen will look for files in the paths (or files) that you specified doxygen will look for files in the paths (or files) that you specified
after the \ref cfg_image_path "IMAGE_PATH" tag. after the \ref cfg_image_path "IMAGE_PATH" tag.
If the image is found it will be copied to the correct output directory. If the image is found it will be copied to the correct output directory.
If the image name contains spaces you'll have to put quotes ("...") around it. If the image name contains spaces you'll have to put quotes ("...") around
You can also specify an absolute URL instead of a file name, but then the name. You can also specify an absolute URL instead of a file name, but then
doxygen does not copy the image nor check its existence. doxygen does not copy the image nor check its existence.
The third argument is optional and can be used to specify the caption The third argument is optional and can be used to specify the caption
...@@ -2914,16 +2915,12 @@ class Receiver ...@@ -2914,16 +2915,12 @@ class Receiver
spaces. The quotes are stripped before the caption is displayed. spaces. The quotes are stripped before the caption is displayed.
The fourth argument is also optional and can be used to specify the The fourth argument is also optional and can be used to specify the
width or height of the image. This can be useful for \LaTeX output width or height of the image. This can be useful for \LaTeX or docbook output
(i.e. format=<code>latex</code>). (i.e. format=<code>latex</code> or format=<code>docbook</code>).
\anchor image_sizeindicator \par Size indication \anchor image_sizeindicator \par Size indication
The \c sizeindication can The \c sizeindication can specify the width or height to be used (or a combination).
specify the width or height to be used )or a combination). Possible The size specifier in \LaTeX (for example `10cm` or
values are (width, analogous for height): `4in` or a symbolic width like `\\textwidth`).
`width` or `max with` or `min width`. The size should be a valid
size specifier in \LaTeX (for example `10cm` or
`6in` or a symbolic width like `\\textwidth`). (The `max width` etc.
are based on the \LaTeX package `adjustbox`)
Here is example of a comment block: Here is example of a comment block:
......
...@@ -46,14 +46,7 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, ...@@ -46,14 +46,7 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name,
t << " <imagedata"; t << " <imagedata";
if (!width.isEmpty()) if (!width.isEmpty())
{ {
tmpStr = width; t << " width=\"" << convertToXML(width) << "\"";
tmpStr = tmpStr.replace(QRegExp("min *width"),"minwidth");
tmpStr = tmpStr.replace(QRegExp("max *width"),"maxwidth");
tmpStr = tmpStr.replace(QRegExp("="),"=\"");
tmpStr = tmpStr.replace(QRegExp(","),"\" ") + "\"";
tmpStr = tmpStr.replace(QRegExp("\"\""),"\"");
tmpStr = tmpStr.replace(QRegExp("\\"),"\\\\");
t << " " << tmpStr;
} }
else else
{ {
...@@ -61,15 +54,7 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, ...@@ -61,15 +54,7 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name,
} }
if (!height.isEmpty()) if (!height.isEmpty())
{ {
tmpStr = height; t << " depth=\"" << convertToXML(tmpStr) << "\"";
tmpStr = tmpStr.replace(QRegExp("min *height"),"mindepth");
tmpStr = tmpStr.replace(QRegExp("max *height"),"maxdepth");
tmpStr = tmpStr.replace(QRegExp("height="),"depth=");
tmpStr = tmpStr.replace(QRegExp("="),"=\"");
tmpStr = tmpStr.replace(QRegExp(","),"\" ") + "\"";
tmpStr = tmpStr.replace(QRegExp("\"\""),"\"");
tmpStr = tmpStr.replace(QRegExp("\\"),"\\\\");
t << " " << tmpStr;
} }
t << " align=\"center\" valign=\"middle\" scalefit=\"1\" fileref=\"" << name << "\">"; t << " align=\"center\" valign=\"middle\" scalefit=\"1\" fileref=\"" << name << "\">";
t << "</imagedata>" << endl; t << "</imagedata>" << endl;
...@@ -1238,7 +1223,7 @@ void DocbookDocVisitor::writeMscFile(const QCString &baseName, DocVerbatim *s) ...@@ -1238,7 +1223,7 @@ void DocbookDocVisitor::writeMscFile(const QCString &baseName, DocVerbatim *s)
QCString outDir = Config_getString("DOCBOOK_OUTPUT"); QCString outDir = Config_getString("DOCBOOK_OUTPUT");
writeMscGraphFromFile(baseName+".msc",outDir,shortName,MSC_BITMAP); writeMscGraphFromFile(baseName+".msc",outDir,shortName,MSC_BITMAP);
visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height()); visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height());
visitCaption(this, s->m_children); visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption()); visitPostEnd(m_t, s->hasCaption());
} }
...@@ -1253,7 +1238,7 @@ void DocbookDocVisitor::writePlantUMLFile(const QCString &baseName, DocVerbatim ...@@ -1253,7 +1238,7 @@ void DocbookDocVisitor::writePlantUMLFile(const QCString &baseName, DocVerbatim
QCString outDir = Config_getString("DOCBOOK_OUTPUT"); QCString outDir = Config_getString("DOCBOOK_OUTPUT");
generatePlantUMLOutput(baseName,outDir,PUML_BITMAP); generatePlantUMLOutput(baseName,outDir,PUML_BITMAP);
visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height()); visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height());
visitCaption(this, s->m_children); visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption()); visitPostEnd(m_t, s->hasCaption());
} }
...@@ -1298,7 +1283,7 @@ void DocbookDocVisitor::writeDiaFile(const QCString &baseName, DocVerbatim *s) ...@@ -1298,7 +1283,7 @@ void DocbookDocVisitor::writeDiaFile(const QCString &baseName, DocVerbatim *s)
QCString outDir = Config_getString("DOCBOOK_OUTPUT"); QCString outDir = Config_getString("DOCBOOK_OUTPUT");
writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DIA_BITMAP); writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DIA_BITMAP);
visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height()); visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height());
visitCaption(this, s->m_children); visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption()); visitPostEnd(m_t, s->hasCaption());
} }
...@@ -1344,7 +1329,7 @@ void DocbookDocVisitor::writeDotFile(const QCString &baseName, DocVerbatim *s) ...@@ -1344,7 +1329,7 @@ void DocbookDocVisitor::writeDotFile(const QCString &baseName, DocVerbatim *s)
QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT");
writeDotGraphFromFile(baseName+".dot",outDir,shortName,GOF_BITMAP); writeDotGraphFromFile(baseName+".dot",outDir,shortName,GOF_BITMAP);
visitPreStart(m_t, s->hasCaption(), baseName + ".dot", s->width(),s->height()); visitPreStart(m_t, s->hasCaption(), baseName + ".dot", s->width(),s->height());
visitCaption(this, s->m_children); visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption()); visitPostEnd(m_t, s->hasCaption());
} }
......
This diff is collapsed.
...@@ -451,7 +451,10 @@ class DocVerbatim : public DocNode ...@@ -451,7 +451,10 @@ class DocVerbatim : public DocNode
QCString width() const { return m_width; } QCString width() const { return m_width; }
QCString height() const { return m_height; } QCString height() const { return m_height; }
const QList<DocNode> &children() const { return m_children; } const QList<DocNode> &children() const { return m_children; }
QList<DocNode> &children() { return m_children; } QList<DocNode> &children() { return m_children; }
void setText(const QCString &t) { m_text=t; }
void setWidth(const QCString &w) { m_width=w; }
void setHeight(const QCString &h) { m_height=h; }
private: private:
QCString m_context; QCString m_context;
...@@ -462,7 +465,6 @@ class DocVerbatim : public DocNode ...@@ -462,7 +465,6 @@ class DocVerbatim : public DocNode
QCString m_relPath; QCString m_relPath;
QCString m_lang; QCString m_lang;
bool m_isBlock; bool m_isBlock;
public:
QCString m_width; QCString m_width;
QCString m_height; QCString m_height;
QList<DocNode> m_children; QList<DocNode> m_children;
...@@ -1123,9 +1125,7 @@ class DocPara : public CompAccept<DocPara>, public DocNode ...@@ -1123,9 +1125,7 @@ class DocPara : public CompAccept<DocPara>, public DocNode
int direction); int direction);
void handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type t); void handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type t);
void handleImage(const QCString &cmdName); void handleImage(const QCString &cmdName);
void handleDotFile(const QCString &cmdName); template<class T> void handleFile(const QCString &cmdName);
void handleMscFile(const QCString &cmdName);
void handleDiaFile(const QCString &cmdName);
void handleInclude(const QCString &cmdName,DocInclude::Type t); void handleInclude(const QCString &cmdName,DocInclude::Type t);
void handleLink(const QCString &cmdName,bool isJavaLink); void handleLink(const QCString &cmdName,bool isJavaLink);
void handleCite(); void handleCite();
......
...@@ -131,10 +131,8 @@ void doctokenizerYYpushContext(); ...@@ -131,10 +131,8 @@ void doctokenizerYYpushContext();
bool doctokenizerYYpopContext(); bool doctokenizerYYpopContext();
int doctokenizerYYlex(); int doctokenizerYYlex();
void doctokenizerYYsetStatePara(); void doctokenizerYYsetStatePara();
void doctokenizerYYsetStateCaption();
void doctokenizerYYsetStateTitle(); void doctokenizerYYsetStateTitle();
void doctokenizerYYsetStateTitleAttrValue(); void doctokenizerYYsetStateTitleAttrValue();
void doctokenizerYYsetStateTitleAttr();
void doctokenizerYYsetStateCode(); void doctokenizerYYsetStateCode();
void doctokenizerYYsetStateXmlCode(); void doctokenizerYYsetStateXmlCode();
void doctokenizerYYsetStateHtmlOnly(); void doctokenizerYYsetStateHtmlOnly();
......
...@@ -404,7 +404,6 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} ...@@ -404,7 +404,6 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4}
%x St_Para %x St_Para
%x St_Comment %x St_Comment
%x St_Title %x St_Title
%x St_Caption
%x St_TitleN %x St_TitleN
%x St_TitleQ %x St_TitleQ
%x St_TitleA %x St_TitleA
...@@ -860,12 +859,22 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} ...@@ -860,12 +859,22 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4}
<St_Msc>. { /* msc text */ <St_Msc>. { /* msc text */
g_token->verb+=yytext; g_token->verb+=yytext;
} }
<St_PlantUMLOpt>{BLANK}*"{"[^}]*"}" { // skip curly brackets around the optional image name <St_PlantUMLOpt>{BLANK}*"{"[^}]*"}" { // case 1: file name is specified as {filename}
g_token->sectionId = yytext; g_token->sectionId = QCString(yytext).stripWhiteSpace();
g_token->sectionId = g_token->sectionId.stripWhiteSpace(); // skip curly brackets around the optional image name
g_token->sectionId = g_token->sectionId.left(g_token->sectionId.length()-1); g_token->sectionId = g_token->sectionId.mid(1,g_token->sectionId.length()-2).stripWhiteSpace();
g_token->sectionId = g_token->sectionId.right(g_token->sectionId.length()-1); return RetVal_OK;
g_token->sectionId = g_token->sectionId.stripWhiteSpace(); }
<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}+/{ID}"=" { // case 2: plain file name specified followed by an attribute
g_token->sectionId = QCString(yytext).stripWhiteSpace();
return RetVal_OK;
}
<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}+/"\"" { // case 3: plain file name specified followed by a quoted title
g_token->sectionId = QCString(yytext).stripWhiteSpace();
return RetVal_OK;
}
<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}*/\n { // case 4: plain file name specified without title or attributes
g_token->sectionId = QCString(yytext).stripWhiteSpace();
return RetVal_OK; return RetVal_OK;
} }
<St_PlantUMLOpt>. { <St_PlantUMLOpt>. {
...@@ -881,22 +890,9 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} ...@@ -881,22 +890,9 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4}
<St_PlantUML>. { /* plantuml text */ <St_PlantUML>. { /* plantuml text */
g_token->verb+=yytext; g_token->verb+=yytext;
} }
<St_Caption>"\"" { // quoted title
BEGIN(St_TitleQ);
return TK_WORD;
}
<St_Caption>[ \t]+ {
g_token->name="";
g_token->chars=yytext;
return TK_WHITESPACE;
}
<St_Caption>\n {
unput(*yytext);
return 0;
}
<St_Title>"\"" { // quoted title <St_Title>"\"" { // quoted title
BEGIN(St_TitleQ); BEGIN(St_TitleQ);
} }
<St_Title>[ \t]+ { <St_Title>[ \t]+ {
g_token->chars=yytext; g_token->chars=yytext;
return TK_WHITESPACE; return TK_WHITESPACE;
...@@ -921,6 +917,13 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} ...@@ -921,6 +917,13 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4}
g_token->paramDir=TokenInfo::Unspecified; g_token->paramDir=TokenInfo::Unspecified;
return TK_COMMAND; return TK_COMMAND;
} }
<St_TitleN>{ID}"=" { /* attribute */
if (yytext[0]=='%') // strip % if present
g_token->name = &yytext[1];
else
g_token->name = yytext;
return TK_WORD;
}
<St_TitleN>{WORD1} | <St_TitleN>{WORD1} |
<St_TitleN>{WORD2} { /* word */ <St_TitleN>{WORD2} { /* word */
if (yytext[0]=='%') // strip % if present if (yytext[0]=='%') // strip % if present
...@@ -964,38 +967,9 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} ...@@ -964,38 +967,9 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4}
unput(*yytext); unput(*yytext);
return 0; return 0;
} }
<St_Caption>{BLANK}*"min"{BLANK}* { // title special case min / max
g_token->name = "min";
BEGIN(St_TitleA);
return TK_WORD;
}
<St_Caption>{BLANK}*"max"{BLANK}* { // title special case min / max
g_token->name = "max";
BEGIN(St_TitleA);
return TK_WORD;
}
<St_Caption>{BLANK}*"width="{BLANK}* { // title attribute
g_token->name = yytext;
g_token->name = g_token->name.stripWhiteSpace();
BEGIN(St_TitleV);
}
<St_Caption>{BLANK}*"height="{BLANK}* { // title attribute
g_token->name = yytext;
g_token->name = g_token->name.stripWhiteSpace();
BEGIN(St_TitleV);
}
<St_TitleA>{BLANK}*"min"{BLANK}* { // title special case min / max
g_token->name = "min";
return TK_WORD;
}
<St_TitleA>{BLANK}*"max"{BLANK}* { // title special case min / max
g_token->name = "max";
return TK_WORD;
}
<St_TitleA>{BLANK}*{ID}{BLANK}*"="{BLANK}* { // title attribute <St_TitleA>{BLANK}*{ID}{BLANK}*"="{BLANK}* { // title attribute
g_token->name = yytext; g_token->name = yytext;
g_token->name = g_token->name.left( g_token->name = g_token->name.left(g_token->name.find('=')).stripWhiteSpace();
g_token->name.find('=')).stripWhiteSpace();
BEGIN(St_TitleV); BEGIN(St_TitleV);
} }
<St_TitleV>[^ \t\r\n]+ { // attribute value <St_TitleV>[^ \t\r\n]+ { // attribute value
...@@ -1003,10 +977,6 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} ...@@ -1003,10 +977,6 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4}
BEGIN(St_TitleN); BEGIN(St_TitleN);
return TK_WORD; return TK_WORD;
} }
<St_TitleV,St_TitleA>[ \t] {
g_token->chars=yytext;
return TK_WHITESPACE;
}
<St_TitleV,St_TitleA>. { <St_TitleV,St_TitleA>. {
unput(*yytext); unput(*yytext);
return 0; return 0;
...@@ -1351,16 +1321,6 @@ void doctokenizerYYsetStateTitle() ...@@ -1351,16 +1321,6 @@ void doctokenizerYYsetStateTitle()
BEGIN(St_Title); BEGIN(St_Title);
} }
void doctokenizerYYsetStateCaption()
{
BEGIN(St_Caption);
}
void doctokenizerYYsetStateTitleAttr()
{
BEGIN(St_TitleA);
}
void doctokenizerYYsetStateTitleAttrValue() void doctokenizerYYsetStateTitleAttrValue()
{ {
BEGIN(St_TitleV); BEGIN(St_TitleV);
......
...@@ -427,7 +427,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s) ...@@ -427,7 +427,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
m_t << "<div align=\"center\">" << endl; m_t << "<div align=\"center\">" << endl;
writeDotFile(fileName,s->relPath(),s->context()); writeDotFile(fileName,s->relPath(),s->context());
visitPreCaption(m_t, s); visitPreCaption(m_t, s);
visitCaption(this, s->m_children); visitCaption(this, s->children());
visitPostCaption(m_t, s); visitPostCaption(m_t, s);
m_t << "</div>" << endl; m_t << "</div>" << endl;
...@@ -464,7 +464,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s) ...@@ -464,7 +464,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
m_t << "<div align=\"center\">" << endl; m_t << "<div align=\"center\">" << endl;
writeMscFile(baseName+".msc",s->relPath(),s->context()); writeMscFile(baseName+".msc",s->relPath(),s->context());
visitPreCaption(m_t, s); visitPreCaption(m_t, s);
visitCaption(this, s->m_children); visitCaption(this, s->children());
visitPostCaption(m_t, s); visitPostCaption(m_t, s);
m_t << "</div>" << endl; m_t << "</div>" << endl;
...@@ -482,7 +482,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s) ...@@ -482,7 +482,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
m_t << "<div align=\"center\">" << endl; m_t << "<div align=\"center\">" << endl;
writePlantUMLFile(baseName,s->relPath(),s->context()); writePlantUMLFile(baseName,s->relPath(),s->context());
visitPreCaption(m_t, s); visitPreCaption(m_t, s);
visitCaption(this, s->m_children); visitCaption(this, s->children());
visitPostCaption(m_t, s); visitPostCaption(m_t, s);
m_t << "</div>" << endl; m_t << "</div>" << endl;
forceStartParagraph(s); forceStartParagraph(s);
......
...@@ -90,7 +90,7 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, ...@@ -90,7 +90,7 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name,
} }
if (!width.isEmpty()) if (!width.isEmpty())
{ {
t << width; t << "width=" << width;
} }
if (!width.isEmpty() && !height.isEmpty()) if (!width.isEmpty() && !height.isEmpty())
{ {
...@@ -98,7 +98,7 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, ...@@ -98,7 +98,7 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name,
} }
if (!height.isEmpty()) if (!height.isEmpty())
{ {
t << height; t << "height=" << height;
} }
if (width.isEmpty() && height.isEmpty()) if (width.isEmpty() && height.isEmpty())
{ {
...@@ -359,7 +359,7 @@ void LatexDocVisitor::visit(DocVerbatim *s) ...@@ -359,7 +359,7 @@ void LatexDocVisitor::visit(DocVerbatim *s)
file.close(); file.close();
startDotFile(fileName,s->width(),s->height(),s->hasCaption()); startDotFile(fileName,s->width(),s->height(),s->hasCaption());
visitCaption(this, s->m_children); visitCaption(this, s->children());
endDotFile(s->hasCaption()); endDotFile(s->hasCaption());
if (Config_getBool("DOT_CLEANUP")) file.remove(); if (Config_getBool("DOT_CLEANUP")) file.remove();
...@@ -1701,7 +1701,7 @@ void LatexDocVisitor::writeMscFile(const QCString &baseName, DocVerbatim *s) ...@@ -1701,7 +1701,7 @@ void LatexDocVisitor::writeMscFile(const QCString &baseName, DocVerbatim *s)
QCString outDir = Config_getString("LATEX_OUTPUT"); QCString outDir = Config_getString("LATEX_OUTPUT");
writeMscGraphFromFile(baseName+".msc",outDir,shortName,MSC_EPS); writeMscGraphFromFile(baseName+".msc",outDir,shortName,MSC_EPS);
visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height()); visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height());
visitCaption(this, s->m_children); visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption()); visitPostEnd(m_t, s->hasCaption());
} }
...@@ -1747,7 +1747,7 @@ void LatexDocVisitor::writeDiaFile(const QCString &baseName, DocVerbatim *s) ...@@ -1747,7 +1747,7 @@ void LatexDocVisitor::writeDiaFile(const QCString &baseName, DocVerbatim *s)
QCString outDir = Config_getString("LATEX_OUTPUT"); QCString outDir = Config_getString("LATEX_OUTPUT");
writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DIA_EPS); writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DIA_EPS);
visitPreStart(m_t, s->hasCaption(), shortName, s->width(), s->height()); visitPreStart(m_t, s->hasCaption(), shortName, s->width(), s->height());
visitCaption(this, s->m_children); visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption()); visitPostEnd(m_t, s->hasCaption());
} }
...@@ -1762,7 +1762,7 @@ void LatexDocVisitor::writePlantUMLFile(const QCString &baseName, DocVerbatim *s ...@@ -1762,7 +1762,7 @@ void LatexDocVisitor::writePlantUMLFile(const QCString &baseName, DocVerbatim *s
QCString outDir = Config_getString("LATEX_OUTPUT"); QCString outDir = Config_getString("LATEX_OUTPUT");
generatePlantUMLOutput(baseName,outDir,PUML_EPS); generatePlantUMLOutput(baseName,outDir,PUML_EPS);
visitPreStart(m_t, s->hasCaption(), shortName, s->width(), s->height()); visitPreStart(m_t, s->hasCaption(), shortName, s->width(), s->height());
visitCaption(this, s->m_children); visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption()); visitPostEnd(m_t, s->hasCaption());
} }
...@@ -1952,10 +1952,10 @@ void LatexGenerator::exceptionEntry(const char* prefix,bool closeBracket) ...@@ -1952,10 +1952,10 @@ void LatexGenerator::exceptionEntry(const char* prefix,bool closeBracket)
void LatexGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *) void LatexGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *)
{ {
LatexDocVisitor *visitor = LatexDocVisitor *visitor =
new LatexDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""),insideTabbing); new LatexDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""),insideTabbing);
n->accept(visitor); n->accept(visitor);
delete visitor; delete visitor;
} }
void LatexGenerator::startConstraintList(const char *header) void LatexGenerator::startConstraintList(const char *header)
......
...@@ -45,7 +45,7 @@ static void visitPreStart(FTextStream &t, const char *cmd, const bool doCaption, ...@@ -45,7 +45,7 @@ static void visitPreStart(FTextStream &t, const char *cmd, const bool doCaption,
const QCString &height) const QCString &height)
{ {
QCString tmpStr; QCString tmpStr;
t << "<" << cmd; t << "<" << cmd;
if (writeType) if (writeType)
{ {
...@@ -65,27 +65,12 @@ static void visitPreStart(FTextStream &t, const char *cmd, const bool doCaption, ...@@ -65,27 +65,12 @@ static void visitPreStart(FTextStream &t, const char *cmd, const bool doCaption,
} }
if (!width.isEmpty()) if (!width.isEmpty())
{ {
tmpStr = width; t << " width=\"" << convertToXML(width) << "\"";
tmpStr = tmpStr.replace(QRegExp("min *width"),"minwidth");
tmpStr = tmpStr.replace(QRegExp("max *width"),"maxwidth");
tmpStr = tmpStr.replace(QRegExp("="),"=\"");
tmpStr = tmpStr.replace(QRegExp(","),"\" ") + "\"";
tmpStr = tmpStr.replace(QRegExp("\"\""),"\"");
tmpStr = tmpStr.replace(QRegExp("\\"),"\\\\");
t << " " << tmpStr;
} }
if (!height.isEmpty()) else if (!height.isEmpty())
{ {
tmpStr = height; t << " height=\"" << convertToXML(height) << "\"";
tmpStr = tmpStr.replace(QRegExp("min *height"),"minheight");
tmpStr = tmpStr.replace(QRegExp("max *height"),"maxheight");
tmpStr = tmpStr.replace(QRegExp("="),"=\"");
tmpStr = tmpStr.replace(QRegExp(","),"\" ") + "\"";
tmpStr = tmpStr.replace(QRegExp("\"\""),"\"");
tmpStr = tmpStr.replace(QRegExp("\\"),"\\\\");
t << " " << tmpStr;
} }
if (doCaption) if (doCaption)
{ {
t << " caption=\""; t << " caption=\"";
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<detaileddescription> <detaileddescription>
<para>Some text. <image type="html" name="sample.png"/> <para>Some text. <image type="html" name="sample.png"/>
<image type="latex" name="sample.png" width="5cm">Doxygen logo</image> <image type="latex" name="sample.png" width="5cm">Doxygen logo</image>
More text. </para> More text. </para>
</detaileddescription> </detaileddescription>
</compounddef> </compounddef>
</doxygen> </doxygen>
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