summaryrefslogtreecommitdiffstats
path: root/src/rtfdocvisitor.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2003-03-30 19:53:04 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2003-03-30 19:53:04 (GMT)
commitb69146af8dce22431fc50dc3fcea6c7fd5fb1063 (patch)
treedcb3e2354df7b19ebd9458aca416a61d4922bc5c /src/rtfdocvisitor.cpp
parentfc0deb3d8c9dad128e1d5f5c90a5dfc0b9d60eea (diff)
downloadDoxygen-b69146af8dce22431fc50dc3fcea6c7fd5fb1063.zip
Doxygen-b69146af8dce22431fc50dc3fcea6c7fd5fb1063.tar.gz
Doxygen-b69146af8dce22431fc50dc3fcea6c7fd5fb1063.tar.bz2
Release-1.3-rc3-20030330
Diffstat (limited to 'src/rtfdocvisitor.cpp')
-rw-r--r--src/rtfdocvisitor.cpp45
1 files changed, 28 insertions, 17 deletions
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index 3d1a127..e10b3f1 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -292,15 +292,15 @@ void RTFDocVisitor::visit(DocVerbatim *s)
m_t << "\\par" << endl;
m_t << rtf_Style_Reset << getStyle("CodeExample");
parseCode(m_ci,s->context(),s->text().latin1(),s->isExample(),s->exampleFile());
- m_t << "\\par" << endl;
+ //m_t << "\\par" << endl;
m_t << "}" << endl;
break;
case DocVerbatim::Verbatim:
m_t << "{" << endl;
m_t << "\\par" << endl;
m_t << rtf_Style_Reset << getStyle("CodeExample");
- filter(s->text());
- m_t << "\\par" << endl;
+ filter(s->text(),TRUE);
+ //m_t << "\\par" << endl;
m_t << "}" << endl;
break;
case DocVerbatim::HtmlOnly:
@@ -572,14 +572,17 @@ void RTFDocVisitor::visitPost(DocSimpleListItem *)
void RTFDocVisitor::visitPre(DocSection *s)
{
if (m_hide) return;
- m_t << "{" // start section
+ m_t << "\\par" << endl <<
+ "{{" // start section
<< rtf_Style_Reset;
QString heading;
- int level = QMIN(s->level()+2,4);
+ int level = QMIN(s->level()+1,4);
heading.sprintf("Heading%d",level);
// set style
- m_t << rtf_Style[heading]->reference;
+ m_t << rtf_Style[heading]->reference << endl;
// make table of contents entry
+ filter(s->title());
+ m_t << endl << "\\par" << "}" << endl;
m_t << "{\\tc\\tcl" << level << " \\v ";
filter(s->title());
m_t << "}" << endl;
@@ -588,8 +591,7 @@ void RTFDocVisitor::visitPre(DocSection *s)
void RTFDocVisitor::visitPost(DocSection *)
{
if (m_hide) return;
- m_t << "\\par" << endl;
- m_t << "}"; // end section
+ m_t << "}" << endl; // end section
}
void RTFDocVisitor::visitPre(DocHtmlList *l)
@@ -686,15 +688,15 @@ void RTFDocVisitor::visitPre(DocHtmlTable *)
m_t << "\\par" << endl;
}
-void RTFDocVisitor::visitPost(DocHtmlTable *t)
+void RTFDocVisitor::visitPost(DocHtmlTable *)
{
if (m_hide) return;
- if (!t->hasCaption())
- {
- m_t << endl;
- m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
- m_t << "{\\row }" << endl;
- }
+ //if (!t->hasCaption())
+ //{
+ // m_t << endl;
+ // m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
+ // m_t << "{\\row }" << endl;
+ //}
m_t << "\\pard" << endl;
}
@@ -724,7 +726,7 @@ void RTFDocVisitor::visitPre(DocHtmlRow *r)
"\\clbrdrb\\brdrs\\brdrw10 "
"\\clbrdrr \\brdrs\\brdrw10 "
"\\cltxlrtb "
- "\\cellx" << (i*columnWidth) << endl;
+ "\\cellx" << ((i+1)*columnWidth) << endl;
}
m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
}
@@ -1091,7 +1093,7 @@ static char* getMultiByte(int c)
return s;
}
-void RTFDocVisitor::filter(const char *str)
+void RTFDocVisitor::filter(const char *str,bool verbatim)
{
if (str)
{
@@ -1121,6 +1123,15 @@ void RTFDocVisitor::filter(const char *str)
case '{': m_t << "\\{"; break;
case '}': m_t << "\\}"; break;
case '\\': m_t << "\\\\"; break;
+ case '\n': if (verbatim)
+ {
+ m_t << "\\par" << endl;
+ }
+ else
+ {
+ m_t << '\n';
+ }
+ break;
default: m_t << (char)c;
}
pc = c;