summaryrefslogtreecommitdiffstats
path: root/src/rtfdocvisitor.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2012-02-20 21:09:54 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2012-02-20 21:09:54 (GMT)
commit34d4ace6d4037862b6d280f1d7534292c714bf59 (patch)
treea9a7b7b5542fbc9a2189f8ae6b39379770043b48 /src/rtfdocvisitor.cpp
parentc22d77a7a9c0f26a060a58047f514869a9e0a067 (diff)
downloadDoxygen-34d4ace6d4037862b6d280f1d7534292c714bf59.zip
Doxygen-34d4ace6d4037862b6d280f1d7534292c714bf59.tar.gz
Doxygen-34d4ace6d4037862b6d280f1d7534292c714bf59.tar.bz2
Release-1.7.6.1-20120220
Diffstat (limited to 'src/rtfdocvisitor.cpp')
-rw-r--r--src/rtfdocvisitor.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index e49a8ed..ceedb2d 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -3,7 +3,7 @@
*
*
*
- * Copyright (C) 1997-2011 by Dimitri van Heesch.
+ * Copyright (C) 1997-2012 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
@@ -34,6 +34,24 @@
//#define DBG_RTF(x) m_t << x
#define DBG_RTF(x) do {} while(0)
+static QCString align(DocHtmlCell *cell)
+{
+ HtmlAttribList attrs = cell->attribs();
+ uint i;
+ for (i=0; i<attrs.count(); ++i)
+ {
+ if (attrs.at(i)->name.lower()=="align")
+ {
+ if (attrs.at(i)->value.lower()=="center")
+ return "\\qc ";
+ else if (attrs.at(i)->value.lower()=="right")
+ return "\\qr ";
+ else return "";
+ }
+ }
+ return "";
+}
+
RTFDocVisitor::RTFDocVisitor(FTextStream &t,CodeOutputInterface &ci,
const char *langExt)
: DocVisitor(DocVisitor_RTF), m_t(t), m_ci(ci), m_insidePre(FALSE),
@@ -931,7 +949,8 @@ void RTFDocVisitor::visitPost(DocHtmlTable *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlTable)}\n");
- m_t << "\\pard" << endl;
+ m_t << "\\pard\\plain" << endl;
+ m_t << "\\par" << endl;
m_lastIsPara=TRUE;
}
@@ -959,6 +978,10 @@ void RTFDocVisitor::visitPre(DocHtmlRow *r)
"\\trbrdrv\\brdrs\\brdrw10 "<< endl;
for (i=0;i<r->numCells();i++)
{
+ if (r->isHeading())
+ {
+ m_t << "\\clcbpat16"; // set cell shading to light grey (color 16 in the clut)
+ }
m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 "
"\\clbrdrl\\brdrs\\brdrw10 "
"\\clbrdrb\\brdrs\\brdrw10 "
@@ -980,11 +1003,11 @@ void RTFDocVisitor::visitPost(DocHtmlRow *)
m_lastIsPara=FALSE;
}
-void RTFDocVisitor::visitPre(DocHtmlCell *)
+void RTFDocVisitor::visitPre(DocHtmlCell *c)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlCell)}\n");
- m_t << "{";
+ m_t << "{" << align(c);
m_lastIsPara=FALSE;
}