summaryrefslogtreecommitdiffstats
path: root/src/rtfdocvisitor.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-08-10 18:09:33 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-08-10 18:09:33 (GMT)
commit7506404e646f1fcc5a26ca6fca91a7f65154f05a (patch)
treef97964759aa6238f02bd5b7f853306c19965914d /src/rtfdocvisitor.cpp
parent97d12d058a7831adcc8c6f2cfe8c20ddd2ae5bc2 (diff)
downloadDoxygen-7506404e646f1fcc5a26ca6fca91a7f65154f05a.zip
Doxygen-7506404e646f1fcc5a26ca6fca91a7f65154f05a.tar.gz
Doxygen-7506404e646f1fcc5a26ca6fca91a7f65154f05a.tar.bz2
Bug 731947 - Support for PlantUML
Diffstat (limited to 'src/rtfdocvisitor.cpp')
-rw-r--r--src/rtfdocvisitor.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index 0d17208..5e27137 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -16,6 +16,8 @@
*
*/
+#include <qfileinfo.h>
+
#include "rtfdocvisitor.h"
#include "docparser.h"
#include "language.h"
@@ -26,13 +28,13 @@
#include "util.h"
#include "rtfstyle.h"
#include "message.h"
-#include <qfileinfo.h>
#include "parserintf.h"
#include "msc.h"
#include "dia.h"
#include "filedef.h"
#include "config.h"
#include "htmlentity.h"
+#include "plantuml.h"
//#define DBG_RTF(x) m_t << x
#define DBG_RTF(x) do {} while(0)
@@ -317,6 +319,16 @@ void RTFDocVisitor::visit(DocVerbatim *s)
if (Config_getBool("DOT_CLEANUP")) file.remove();
}
break;
+ case DocVerbatim::PlantUML:
+ {
+ static QCString rtfOutput = Config_getString("RTF_OUTPUT");
+ QCString baseName = writePlantUMLSource(rtfOutput,s->exampleFile(),s->text());
+
+ m_t << "\\par{\\qc "; // center picture
+ writePlantUMLFile(baseName);
+ m_t << "} ";
+ }
+ break;
}
m_lastIsPara=FALSE;
}
@@ -1704,3 +1716,23 @@ void RTFDocVisitor::writeDiaFile(const QCString &fileName)
m_lastIsPara=TRUE;
}
+void RTFDocVisitor::writePlantUMLFile(const QCString &fileName)
+{
+ QCString baseName=fileName;
+ int i;
+ if ((i=baseName.findRev('/'))!=-1)
+ {
+ baseName=baseName.right(baseName.length()-i-1);
+ }
+ QCString outDir = Config_getString("RTF_OUTPUT");
+ generatePlantUMLOutput(fileName,outDir,PUML_BITMAP);
+ if (!m_lastIsPara) m_t << "\\par" << endl;
+ m_t << "{" << endl;
+ m_t << rtf_Style_Reset;
+ m_t << "\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
+ m_t << baseName << ".png";
+ m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
+ m_t << "}" << endl;
+ m_lastIsPara=TRUE;
+}
+