diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2013-10-06 19:28:00 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2013-10-06 21:39:40 (GMT) |
commit | 4fc5b2b154331fbf35800935889f1d0372334f0a (patch) | |
tree | a87e075516435e0d855a4af6aecb356a517c4b33 /src/rtfdocvisitor.cpp | |
parent | 983507e0a65e5c2d51209740a89311e122e4f389 (diff) | |
download | Doxygen-4fc5b2b154331fbf35800935889f1d0372334f0a.zip Doxygen-4fc5b2b154331fbf35800935889f1d0372334f0a.tar.gz Doxygen-4fc5b2b154331fbf35800935889f1d0372334f0a.tar.bz2 |
Bug 707713 - Add support for dia diagrams
Diffstat (limited to 'src/rtfdocvisitor.cpp')
-rw-r--r-- | src/rtfdocvisitor.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 3cf6a5e..5d73c57 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -29,6 +29,7 @@ #include <qfileinfo.h> #include "parserintf.h" #include "msc.h" +#include "dia.h" #include "filedef.h" #include "config.h" @@ -1245,6 +1246,22 @@ void RTFDocVisitor::visitPost(DocMscFile *) popEnabled(); } +void RTFDocVisitor::visitPre(DocDiaFile *df) +{ + DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocDiaFile)}\n"); + writeDiaFile(df->file()); + + // hide caption since it is not supported at the moment + pushEnabled(); + m_hide=TRUE; +} + +void RTFDocVisitor::visitPost(DocDiaFile *) +{ + DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocDiaFile)}\n"); + popEnabled(); +} + void RTFDocVisitor::visitPre(DocLink *lnk) { if (m_hide) return; @@ -1846,3 +1863,23 @@ void RTFDocVisitor::writeMscFile(const QCString &fileName) m_lastIsPara=TRUE; } +void RTFDocVisitor::writeDiaFile(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"); + writeDiaGraphFromFile(fileName+".dia",outDir,baseName,DIA_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; +} + |