summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2018-06-10 08:55:36 (GMT)
committerGitHub <noreply@github.com>2018-06-10 08:55:36 (GMT)
commitd86bbe7295209421287d6407cf03ea6a9ba8c8a2 (patch)
tree66412432c73f1fd1c3309c2d2763907e804f8b3b /src
parentf13ef432966ce28da0bccfb93e00e3b5ed7fe7dc (diff)
parent79ac5232cf029f3d40543641e92daa8aaa1c9f7c (diff)
downloadDoxygen-d86bbe7295209421287d6407cf03ea6a9ba8c8a2.zip
Doxygen-d86bbe7295209421287d6407cf03ea6a9ba8c8a2.tar.gz
Doxygen-d86bbe7295209421287d6407cf03ea6a9ba8c8a2.tar.bz2
Merge pull request #756 from albert-github/feature/bug_rtf_formula
Add formula (images) to RTF output
Diffstat (limited to 'src')
-rw-r--r--src/doxygen.cpp6
-rw-r--r--src/rtfdocvisitor.cpp16
2 files changed, 20 insertions, 2 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 263b59f..bc244b7 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -11558,6 +11558,12 @@ void generateOutput()
Doxygen::formulaList->generateBitmaps(Config_getString(HTML_OUTPUT));
g_s.end();
}
+ if (Doxygen::formulaList->count()>0 && generateRtf)
+ {
+ g_s.begin("Generating bitmaps for formulas in RTF...\n");
+ Doxygen::formulaList->generateBitmaps(Config_getString(RTF_OUTPUT));
+ g_s.end();
+ }
if (Config_getBool(SORT_GROUP_NAMES))
{
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index c85b638..7e3f104 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -526,9 +526,21 @@ void RTFDocVisitor::visit(DocIncOperator *op)
void RTFDocVisitor::visit(DocFormula *f)
{
if (m_hide) return;
- // TODO: do something sensible here, like including a bitmap
DBG_RTF("{\\comment RTFDocVisitor::visit(DocFormula)}\n");
- m_t << f->text();
+ bool bDisplay = !f->isInline();
+ if (bDisplay)
+ {
+ m_t << "\\par";
+ m_t << "{";
+ m_t << "\\pard\\plain";
+ m_t << "\\pard";
+ m_t << "\\qc";
+ }
+ m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << f->relPath() << f->name() << ".png\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}";
+ if (bDisplay)
+ {
+ m_t << "\\par}";
+ }
m_lastIsPara=FALSE;
}