summaryrefslogtreecommitdiffstats
path: root/src/rtfgen.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-04-29 17:26:11 (GMT)
committerGitHub <noreply@github.com>2021-04-29 17:26:11 (GMT)
commitb8a3ff6c33264c43cdf30c04baa9793e7e8d51a2 (patch)
tree9d60ced4b8fceb00c068b56d699c1ba57540d415 /src/rtfgen.cpp
parent4dba9fbdda10889d2285b85b7e9ff6282b34fccf (diff)
parentc6d77227efaf332a5d24bc12d32f4b1fec6b13b9 (diff)
downloadDoxygen-b8a3ff6c33264c43cdf30c04baa9793e7e8d51a2.zip
Doxygen-b8a3ff6c33264c43cdf30c04baa9793e7e8d51a2.tar.gz
Doxygen-b8a3ff6c33264c43cdf30c04baa9793e7e8d51a2.tar.bz2
Merge branch 'master' into feature/bug_305773
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r--src/rtfgen.cpp1905
1 files changed, 973 insertions, 932 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index 94b6893..0fac0b4 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -17,12 +17,10 @@
*
*/
+#include <chrono>
+#include <ctime>
#include <stdlib.h>
-#include <qdir.h>
-#include <qregexp.h>
-#include <qtextstream.h>
-
#include "rtfgen.h"
#include "config.h"
#include "message.h"
@@ -47,17 +45,23 @@
#include "classlist.h"
#include "filename.h"
#include "namespacedef.h"
+#include "dir.h"
+#include "utf8.h"
+
//#define DBG_RTF(x) x;
#define DBG_RTF(x)
static QCString dateToRTFDateString()
{
- const QDateTime &d = QDateTime::currentDateTime();
+ auto now = std::chrono::system_clock::now();
+ auto time = std::chrono::system_clock::to_time_t(now);
+ auto tm = *localtime(&time);
+
QCString result;
result.sprintf("\\yr%d\\mo%d\\dy%d\\hr%d\\min%d\\sec%d",
- d.date().year(), d.date().month(), d.date().day(),
- d.time().hour(),d.time().minute(),d.time().second());
+ tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
+ tm.tm_hour, tm.tm_min, tm.tm_sec);
return result;
}
@@ -94,9 +98,8 @@ void RTFGenerator::setSourceFileName(const QCString &name)
m_sourceFileName = name;
}
-void RTFGenerator::writeStyleSheetFile(QFile &file)
+void RTFGenerator::writeStyleSheetFile(TextStream &t)
{
- FTextStream t(&file);
t << "# Generated by doxygen " << getDoxygenVersion() << "\n\n";
t << "# This file describes styles used for generating RTF output.\n";
t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
@@ -107,13 +110,12 @@ void RTFGenerator::writeStyleSheetFile(QFile &file)
{
t << "# " << rtf_Style_Default[i].name << " = "
<< rtf_Style_Default[i].reference
- << rtf_Style_Default[i].definition << endl;
+ << rtf_Style_Default[i].definition << "\n";
}
}
-void RTFGenerator::writeExtensionsFile(QFile &file)
+void RTFGenerator::writeExtensionsFile(TextStream &t)
{
- FTextStream t(&file);
t << "# Generated by doxygen " << getDoxygenVersion() << "\n\n";
t << "# This file describes extensions used for generating RTF output.\n";
t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
@@ -167,16 +169,15 @@ void RTFGenerator::writeExtensionsFile(QFile &file)
void RTFGenerator::init()
{
QCString dir=Config_getString(RTF_OUTPUT);
- QDir d(dir);
- if (!d.exists() && !d.mkdir(dir))
+ Dir d(dir.str());
+ if (!d.exists() && !d.mkdir(dir.str()))
{
- term("Could not create output directory %s\n",dir.data());
+ term("Could not create output directory %s\n",qPrint(dir));
}
- rtf_Style.setAutoDelete(TRUE);
// first duplicate strings of rtf_Style_Default
const struct Rtf_Style_Default* def = rtf_Style_Default;
- while(def->reference != 0)
+ while (def->reference)
{
if (def->definition == 0)
{
@@ -184,8 +185,7 @@ void RTFGenerator::init()
}
else
{
- StyleData* styleData = new StyleData(def->reference, def->definition);
- rtf_Style.insert(def->name, styleData);
+ rtf_Style.insert(std::make_pair(def->name, StyleData(def->reference, def->definition)));
}
def++;
}
@@ -207,7 +207,7 @@ void RTFGenerator::init()
createSubDirs(d);
}
-static QCString makeIndexName(const char *s,int i)
+static QCString makeIndexName(const QCString &s,int i)
{
QCString result=s;
result+=(char)(i+'0');
@@ -219,160 +219,156 @@ void RTFGenerator::beginRTFDocument()
/* all the included RTF files should begin with the
* same header
*/
- t <<"{\\rtf1\\ansi\\ansicpg" << theTranslator->trRTFansicp();
- t <<"\\uc1 \\deff0\\deflang1033\\deflangfe1033\n";
-
- DBG_RTF(t <<"{\\comment Beginning font list}\n")
- t <<"{\\fonttbl ";
- t <<"{\\f0\\froman\\fcharset" << theTranslator->trRTFCharSet();
- t <<"\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\n";
- t <<"{\\f1\\fswiss\\fcharset" << theTranslator->trRTFCharSet();
- t <<"\\fprq2{\\*\\panose 020b0604020202020204}Arial;}\n";
- t <<"{\\f2\\fmodern\\fcharset" << theTranslator->trRTFCharSet();
- t <<"\\fprq1{\\*\\panose 02070309020205020404}Courier New;}\n";
- t <<"{\\f3\\froman\\fcharset2\\fprq2{\\*\\panose 05050102010706020507}Symbol;}\n";
- t <<"}\n";
- DBG_RTF(t <<"{\\comment begin colors}\n")
- t <<"{\\colortbl;";
- t <<"\\red0\\green0\\blue0;";
- t <<"\\red0\\green0\\blue255;";
- t <<"\\red0\\green255\\blue255;";
- t <<"\\red0\\green255\\blue0;";
- t <<"\\red255\\green0\\blue255;";
- t <<"\\red255\\green0\\blue0;";
- t <<"\\red255\\green255\\blue0;";
- t <<"\\red255\\green255\\blue255;";
- t <<"\\red0\\green0\\blue128;";
- t <<"\\red0\\green128\\blue128;";
- t <<"\\red0\\green128\\blue0;";
- t <<"\\red128\\green0\\blue128;";
- t <<"\\red128\\green0\\blue0;";
- t <<"\\red128\\green128\\blue0;";
- t <<"\\red128\\green128\\blue128;";
- t <<"\\red192\\green192\\blue192;";
+ m_t << "{\\rtf1\\ansi\\ansicpg" << theTranslator->trRTFansicp();
+ m_t << "\\uc1 \\deff0\\deflang1033\\deflangfe1033\n";
+
+ DBG_RTF(m_t << "{\\comment Beginning font list}\n")
+ m_t << "{\\fonttbl ";
+ m_t << "{\\f0\\froman\\fcharset" << theTranslator->trRTFCharSet();
+ m_t << "\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\n";
+ m_t << "{\\f1\\fswiss\\fcharset" << theTranslator->trRTFCharSet();
+ m_t << "\\fprq2{\\*\\panose 020b0604020202020204}Arial;}\n";
+ m_t << "{\\f2\\fmodern\\fcharset" << theTranslator->trRTFCharSet();
+ m_t << "\\fprq1{\\*\\panose 02070309020205020404}Courier New;}\n";
+ m_t << "{\\f3\\froman\\fcharset2\\fprq2{\\*\\panose 05050102010706020507}Symbol;}\n";
+ m_t << "}\n";
+ DBG_RTF(m_t << "{\\comment begin colors}\n")
+ m_t << "{\\colortbl;";
+ m_t << "\\red0\\green0\\blue0;";
+ m_t << "\\red0\\green0\\blue255;";
+ m_t << "\\red0\\green255\\blue255;";
+ m_t << "\\red0\\green255\\blue0;";
+ m_t << "\\red255\\green0\\blue255;";
+ m_t << "\\red255\\green0\\blue0;";
+ m_t << "\\red255\\green255\\blue0;";
+ m_t << "\\red255\\green255\\blue255;";
+ m_t << "\\red0\\green0\\blue128;";
+ m_t << "\\red0\\green128\\blue128;";
+ m_t << "\\red0\\green128\\blue0;";
+ m_t << "\\red128\\green0\\blue128;";
+ m_t << "\\red128\\green0\\blue0;";
+ m_t << "\\red128\\green128\\blue0;";
+ m_t << "\\red128\\green128\\blue128;";
+ m_t << "\\red192\\green192\\blue192;";
// code highlighting colors. Note order is important see also RTFGenerator::startFontClass
- t <<"\\red0\\green128\\blue0;"; // keyword = index 17
- t <<"\\red96\\green64\\blue32;"; // keywordtype
- t <<"\\rede0\\green128\\blue0;"; // keywordflow
- t <<"\\red128\\green0\\blue0;"; // comment
- t <<"\\red128\\green96\\blue32;"; // preprocessor
- t <<"\\red0\\green32\\blue128;"; // stringliteral
- t <<"\\red0\\green128\\blue128;"; // charliteral
- t <<"\\red255\\green0\\blue255;"; // vhdldigit
- t <<"\\red0\\green0\\blue0;"; // vhdlchar
- t <<"\\red112\\green0\\blue112;"; // vhdlkeyword
- t <<"\\red255\\green0\\blue0;"; // vhdllogic
-
- t <<"}\n";
-
- DBG_RTF(t <<"{\\comment Beginning style list}\n")
- t <<"{\\stylesheet\n";
- t <<"{\\widctlpar\\adjustright \\fs20\\cgrid \\snext0 Normal;}\n";
+ m_t << "\\red0\\green128\\blue0;"; // keyword = index 17
+ m_t << "\\red96\\green64\\blue32;"; // keywordtype
+ m_t << "\\rede0\\green128\\blue0;"; // keywordflow
+ m_t << "\\red128\\green0\\blue0;"; // comment
+ m_t << "\\red128\\green96\\blue32;"; // preprocessor
+ m_t << "\\red0\\green32\\blue128;"; // stringliteral
+ m_t << "\\red0\\green128\\blue128;"; // charliteral
+ m_t << "\\red255\\green0\\blue255;"; // vhdldigit
+ m_t << "\\red0\\green0\\blue0;"; // vhdlchar
+ m_t << "\\red112\\green0\\blue112;"; // vhdlkeyword
+ m_t << "\\red255\\green0\\blue0;"; // vhdllogic
+
+ m_t << "}\n";
+
+ DBG_RTF(m_t << "{\\comment Beginning style list}\n")
+ m_t << "{\\stylesheet\n";
+ m_t << "{\\widctlpar\\adjustright \\fs20\\cgrid \\snext0 Normal;}\n";
// set the paper dimensions according to PAPER_TYPE
QCString paperName = Config_getEnum(PAPER_TYPE);
- t << "{";
+ m_t << "{";
if (paperName=="a4")
{
- t << "\\paperw11900\\paperh16840"; // width & height values are inches * 1440
+ m_t << "\\paperw11900\\paperh16840"; // width & height values are inches * 1440
}
else if (paperName=="letter")
{
- t << "\\paperw12240\\paperh15840";
+ m_t << "\\paperw12240\\paperh15840";
}
else if (paperName=="legal")
{
- t << "\\paperw12240\\paperh20160";
+ m_t << "\\paperw12240\\paperh20160";
}
else if (paperName=="executive")
{
- t << "\\paperw10440\\paperh15120";
+ m_t << "\\paperw10440\\paperh15120";
}
- t << "\\margl1800\\margr1800\\margt1440\\margb1440\\gutter0\\ltrsect}\n";
+ m_t << "\\margl1800\\margr1800\\margt1440\\margb1440\\gutter0\\ltrsect}\n";
// sort styles ascending by \s-number via an intermediate QArray
- QDictIterator<StyleData> iter(rtf_Style);
- const StyleData* style = 0;
unsigned maxIndex = 0;
- for(; (style = iter.current()); ++iter)
+ for (const auto &kv : rtf_Style)
{
- uint index = style->index();
- if (maxIndex < index) maxIndex = index;
+ uint index = kv.second.index();
+ if (index > maxIndex) maxIndex = index;
}
std::vector<const StyleData*> array(maxIndex + 1, 0);
ASSERT(maxIndex < array.size());
- iter.toFirst();
- for(; (style = iter.current()); ++iter)
+ for (const auto &kv : rtf_Style)
{
- uint index = style->index();
- if (array.at(index) != 0)
+ uint index = kv.second.index();
+ if (array[index] != 0)
{
- QCString key(iter.currentKey());
- msg("Style '%s' redefines \\s%d.\n", key.data(), index);
+ msg("Style '%s' redefines \\s%d.\n", kv.first.c_str(), index);
}
- array.at(index) = style;
+ array[index] = &kv.second;
}
// write array elements
size_t size = array.size();
for(size_t i = 0; i < size; i++)
{
- style = array.at(i);
- if (style != 0)
+ const StyleData *pStyle = array[i];
+ if (pStyle)
{
- t <<"{" << style->reference() << style->definition() << ";}\n";
+ m_t << "{" << pStyle->reference() << pStyle->definition() << ";}\n";
}
}
- t <<"}" << endl;
+ m_t << "}\n";
// this comment is needed for postprocessing!
- t <<"{\\comment begin body}" << endl;
+ m_t << "{\\comment begin body}\n";
}
void RTFGenerator::beginRTFChapter()
{
- t <<"\n";
- DBG_RTF(t << "{\\comment BeginRTFChapter}\n")
- t << rtf_Style_Reset;
+ m_t << "\n";
+ DBG_RTF(m_t << "{\\comment BeginRTFChapter}\n")
+ m_t << rtf_Style_Reset;
// if we are compact, no extra page breaks...
if (Config_getBool(COMPACT_RTF))
{
- // t <<"\\sect\\sectd\\sbknone\n";
- t <<"\\sect\\sbknone\n";
+ // m_t << "\\sect\\sectd\\sbknone\n";
+ m_t << "\\sect\\sbknone\n";
rtfwriteRuler_thick();
}
else
- t <<"\\sect\\sbkpage\n";
- //t <<"\\sect\\sectd\\sbkpage\n";
+ m_t << "\\sect\\sbkpage\n";
+ //m_t << "\\sect\\sectd\\sbkpage\n";
- t << rtf_Style["Heading1"]->reference() << "\n";
+ m_t << rtf_Style["Heading1"].reference() << "\n";
}
void RTFGenerator::beginRTFSection()
{
- t <<"\n";
- DBG_RTF(t << "{\\comment BeginRTFSection}\n")
- t << rtf_Style_Reset;
+ m_t << "\n";
+ DBG_RTF(m_t << "{\\comment BeginRTFSection}\n")
+ m_t << rtf_Style_Reset;
// if we are compact, no extra page breaks...
if (Config_getBool(COMPACT_RTF))
{
- t <<"\\sect\\sbknone\n";
+ m_t << "\\sect\\sbknone\n";
rtfwriteRuler_emboss();
}
else
{
- t <<"\\sect\\sbkpage\n";
+ m_t << "\\sect\\sbkpage\n";
}
- t << rtf_Style["Heading2"]->reference() << "\n";
+ m_t << rtf_Style["Heading2"].reference() << "\n";
}
-void RTFGenerator::startFile(const char *name,const char *,const char *,int)
+void RTFGenerator::startFile(const QCString &name,const QCString &,const QCString &,int)
{
//setEncoding(QCString().sprintf("CP%s",theTranslator->trRTFansicp()));
QCString fileName=name;
@@ -387,8 +383,8 @@ void RTFGenerator::startFile(const char *name,const char *,const char *,int)
void RTFGenerator::endFile()
{
- DBG_RTF(t << "{\\comment endFile}\n")
- t << "}";
+ DBG_RTF(m_t << "{\\comment endFile}\n")
+ m_t << "}";
endPlainFile();
setSourceFileName("");
@@ -396,13 +392,13 @@ void RTFGenerator::endFile()
void RTFGenerator::startProjectNumber()
{
- DBG_RTF(t <<"{\\comment startProjectNumber }" << endl)
- t << " ";
+ DBG_RTF(m_t << "{\\comment startProjectNumber }\n")
+ m_t << " ";
}
void RTFGenerator::endProjectNumber()
{
- DBG_RTF(t <<"{\\comment endProjectNumber }" << endl)
+ DBG_RTF(m_t << "{\\comment endProjectNumber }\n")
}
void RTFGenerator::startIndexSection(IndexSections is)
@@ -417,19 +413,19 @@ void RTFGenerator::startIndexSection(IndexSections is)
// basic RTFstart
// get readyfor author etc
- t << "{\\info \n";
- t << "{\\title {\\comment ";
+ m_t << "{\\info \n";
+ m_t << "{\\title {\\comment ";
break;
case isTitlePageAuthor:
- t << "}\n";
- if (rtf_subject) t << "{\\subject " << rtf_subject << "}\n";
- if (rtf_comments) t << "{\\comment " << rtf_comments << "}\n";
- if (rtf_company) t << "{\\company " << rtf_company << "}\n";
- if (rtf_author) t << "{\\author " << rtf_author << "}\n";
- if (rtf_manager) t << "{\\manager " << rtf_manager << "}\n";
- if (rtf_documentType) t << "{\\category " << rtf_documentType << "}\n";
- if (rtf_keywords) t << "{\\keywords " << rtf_keywords << "}\n";
- t << "{\\comment ";
+ m_t << "}\n";
+ if (!rtf_subject.isEmpty()) m_t << "{\\subject " << rtf_subject << "}\n";
+ if (!rtf_comments.isEmpty()) m_t << "{\\comment " << rtf_comments << "}\n";
+ if (!rtf_company.isEmpty()) m_t << "{\\company " << rtf_company << "}\n";
+ if (!rtf_author.isEmpty()) m_t << "{\\author " << rtf_author << "}\n";
+ if (!rtf_manager.isEmpty()) m_t << "{\\manager " << rtf_manager << "}\n";
+ if (!rtf_documentType.isEmpty()) m_t << "{\\category " << rtf_documentType << "}\n";
+ if (!rtf_keywords.isEmpty()) m_t << "{\\keywords " << rtf_keywords << "}\n";
+ m_t << "{\\comment ";
break;
case isMainPage:
//Introduction
@@ -451,9 +447,13 @@ void RTFGenerator::startIndexSection(IndexSections is)
//Namespace Index
beginRTFChapter();
break;
+ case isConceptIndex:
+ //Concept Index
+ beginRTFChapter();
+ break;
case isClassHierarchyIndex:
//Hierarchical Index
- DBG_RTF(t << "{\\comment start classhierarchy}\n")
+ DBG_RTF(m_t << "{\\comment start classhierarchy}\n")
beginRTFChapter();
break;
case isCompoundIndex:
@@ -507,6 +507,19 @@ void RTFGenerator::startIndexSection(IndexSections is)
}
}
break;
+ case isConceptDocumentation:
+ {
+ // Concept Documentation
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ if (cd->isLinkableInProject())
+ {
+ beginRTFChapter();
+ break;
+ }
+ }
+ }
+ break;
case isClassDocumentation:
{
//Compound Documentation
@@ -563,7 +576,7 @@ void RTFGenerator::startIndexSection(IndexSections is)
break;
case isPageDocumentation2:
{
- t << "{\\tc \\v ";
+ m_t << "{\\tc \\v ";
}
break;
case isEndIndex:
@@ -581,177 +594,187 @@ void RTFGenerator::endIndexSection(IndexSections is)
switch (is)
{
case isTitlePageStart:
- if (rtf_title)
+ if (!rtf_title.isEmpty())
// User has overridden document title in extensions file
- t << "}" << rtf_title;
+ m_t << "}" << rtf_title;
else
- t << "}" << projectName;
+ m_t << "}" << projectName;
break;
case isTitlePageAuthor:
{
- t << " doxygen" << getDoxygenVersion() << ".}\n";
- t << "{\\creatim " << dateToRTFDateString() << "}\n}";
- DBG_RTF(t << "{\\comment end of infoblock}\n");
+ m_t << " doxygen" << getDoxygenVersion() << ".}\n";
+ m_t << "{\\creatim " << dateToRTFDateString() << "}\n}";
+ DBG_RTF(m_t << "{\\comment end of infoblock}\n");
// setup for this section
- t << rtf_Style_Reset <<"\n";
- t <<"\\sectd\\pgnlcrm\n";
- t <<"{\\footer "<<rtf_Style["Footer"]->reference() << "{\\chpgn}}\n";
+ m_t << rtf_Style_Reset <<"\n";
+ m_t << "\\sectd\\pgnlcrm\n";
+ m_t << "{\\footer "<<rtf_Style["Footer"].reference() << "{\\chpgn}}\n";
// the title entry
- DBG_RTF(t << "{\\comment begin title page}\n")
+ DBG_RTF(m_t << "{\\comment begin title page}\n")
- t << rtf_Style_Reset << rtf_Style["SubTitle"]->reference() << endl; // set to title style
+ m_t << rtf_Style_Reset << rtf_Style["SubTitle"].reference() << "\n"; // set to title style
- t << "\\vertalc\\qc\\par\\par\\par\\par\\par\\par\\par\n";
- if (rtf_logoFilename)
+ m_t << "\\vertalc\\qc\\par\\par\\par\\par\\par\\par\\par\n";
+ if (!rtf_logoFilename.isEmpty())
{
- t << "{\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << rtf_logoFilename;
- t << "\" \\\\d \\\\*MERGEFORMAT} {\\fldrslt IMAGE }}\\par\\par\n";
+ m_t << "{\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << rtf_logoFilename;
+ m_t << "\" \\\\d \\\\*MERGEFORMAT} {\\fldrslt IMAGE }}\\par\\par\n";
}
- if (rtf_company)
+ if (!rtf_company.isEmpty())
{
- t << rtf_company << "\\par\\par\n";
+ m_t << rtf_company << "\\par\\par\n";
}
- t << rtf_Style_Reset << rtf_Style["Title"]->reference() << endl; // set to title style
- if (rtf_title)
+ m_t << rtf_Style_Reset << rtf_Style["Title"].reference() << "\n"; // set to title style
+ if (!rtf_title.isEmpty())
+ {
// User has overridden document title in extensions file
- t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt " << rtf_title << "}}\\par" << endl;
+ m_t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt " << rtf_title << "}}\\par\n";
+ }
else
{
DocText *root = validatingParseText(projectName);
- t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt ";
+ m_t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt ";
writeDoc(root,0,0,0);
- t << "}}\\par" << endl;
-
+ m_t << "}}\\par\n";
}
- t << rtf_Style_Reset << rtf_Style["SubTitle"]->reference() << endl; // set to title style
- t << "\\par\n";
- if (rtf_documentType)
+ m_t << rtf_Style_Reset << rtf_Style["SubTitle"].reference() << "\n"; // set to title style
+ m_t << "\\par\n";
+ if (!rtf_documentType.isEmpty())
{
- t << rtf_documentType << "\\par\n";
+ m_t << rtf_documentType << "\\par\n";
}
- if (rtf_documentId)
+ if (!rtf_documentId.isEmpty())
{
- t << rtf_documentId << "\\par\n";
+ m_t << rtf_documentId << "\\par\n";
}
- t << "\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\n";
+ m_t << "\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\n";
- t << rtf_Style_Reset << rtf_Style["SubTitle"]->reference() << endl; // set to subtitle style
- if (rtf_author)
- t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt "<< rtf_author << " }}\\par" << endl;
+ m_t << rtf_Style_Reset << rtf_Style["SubTitle"].reference() << "\n"; // set to subtitle style
+ if (!rtf_author.isEmpty())
+ {
+ m_t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt "<< rtf_author << " }}\\par\n";
+ }
else
- t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt AUTHOR}}\\par" << endl;
+ {
+ m_t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt AUTHOR}}\\par\n";
+ }
- t << theTranslator->trVersion() << " " << Config_getString(PROJECT_NUMBER) << "\\par";
- t << "{\\field\\fldedit {\\*\\fldinst CREATEDATE \\\\*MERGEFORMAT}"
- "{\\fldrslt "<< dateToString(FALSE) << " }}\\par"<<endl;
- t << "\\page\\page";
- DBG_RTF(t << "{\\comment End title page}" << endl)
+ m_t << theTranslator->trVersion() << " " << Config_getString(PROJECT_NUMBER) << "\\par";
+ m_t << "{\\field\\fldedit {\\*\\fldinst CREATEDATE \\\\*MERGEFORMAT}"
+ "{\\fldrslt "<< dateToString(FALSE) << " }}\\par\n";
+ m_t << "\\page\\page";
+ DBG_RTF(m_t << "{\\comment End title page}\n")
// table of contents section
- DBG_RTF(t << "{\\comment Table of contents}\n")
- t << "\\vertalt\n";
- t << rtf_Style_Reset << endl;
- t << rtf_Style["Heading1"]->reference();
- t << theTranslator->trRTFTableOfContents() << "\\par"<< endl;
- t << rtf_Style_Reset << "\\par" << endl;
- t << "{\\field\\fldedit {\\*\\fldinst TOC \\\\f \\\\*MERGEFORMAT}{\\fldrslt Table of contents}}\\par\n";
- t << rtf_Style_Reset << endl;
+ DBG_RTF(m_t << "{\\comment Table of contents}\n")
+ m_t << "\\vertalt\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << rtf_Style["Heading1"].reference();
+ m_t << theTranslator->trRTFTableOfContents() << "\\par\n";
+ m_t << rtf_Style_Reset << "\\par\n";
+ m_t << "{\\field\\fldedit {\\*\\fldinst TOC \\\\f \\\\*MERGEFORMAT}{\\fldrslt Table of contents}}\\par\n";
+ m_t << rtf_Style_Reset << "\n";
}
break;
case isMainPage:
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!mainPageHasTitle())
{
- t << "{\\tc \\v " << theTranslator->trMainPage() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trMainPage() << "}\n";
}
else
{
- t << "{\\tc \\v " << substitute(Doxygen::mainPage->title(),"%","") << "}"<< endl;
+ m_t << "{\\tc \\v " << substitute(Doxygen::mainPage->title(),"%","") << "}\n";
}
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- //if (Config_getBool(GENERATE_TREEVIEW)) t << "main"; else t << "index";
- t << "index";
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ //if (Config_getBool(GENERATE_TREEVIEW)) m_t << "main"; else m_t << "index";
+ m_t << "index";
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
//case isPackageIndex:
- // t << "\\par " << rtf_Style_Reset << endl;
- // t << "{\\tc \\v " << theTranslator->trPackageList() << "}"<< endl;
- // t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"packages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ // m_t << "\\par " << rtf_Style_Reset << "\n";
+ // m_t << "{\\tc \\v " << theTranslator->trPackageList() << "}\n";
+ // m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"packages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
// break;
case isModuleIndex:
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trModuleIndex() << "}"<< endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"modules.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trModuleIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"modules.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isDirIndex:
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trDirIndex() << "}"<< endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"dirs.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trDirIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"dirs.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isNamespaceIndex:
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (fortranOpt)
{
- t << "{\\tc \\v " << theTranslator->trModulesIndex() << "}" << endl;
+ m_t << "{\\tc \\v " << theTranslator->trModulesIndex() << "}\n";
}
else
{
- t << "{\\tc \\v " << theTranslator->trNamespaceIndex() << "}" << endl;
+ m_t << "{\\tc \\v " << theTranslator->trNamespaceIndex() << "}\n";
}
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"namespaces.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"namespaces.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ break;
+ case isConceptIndex:
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trConceptIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"concepts.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isClassHierarchyIndex:
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trHierarchicalIndex() << "}"<< endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"hierarchy.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trHierarchicalIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"hierarchy.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isCompoundIndex:
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (fortranOpt)
{
- t << "{\\tc \\v " << theTranslator->trCompoundIndexFortran() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trCompoundIndexFortran() << "}\n";
}
else if (vhdlOpt)
{
- t << "{\\tc \\v " << theTranslator->trDesignUnitIndex() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trDesignUnitIndex() << "}\n";
}
else
{
- t << "{\\tc \\v " << theTranslator->trCompoundIndex() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trCompoundIndex() << "}\n";
}
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"annotated.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"annotated.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isFileIndex:
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trFileIndex() << "}"<< endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"files.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trFileIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"files.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isPageIndex:
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trPageIndex() << "}"<< endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"pages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trPageIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"pages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isModuleDocumentation:
{
bool first=true;
- t << "{\\tc \\v " << theTranslator->trModuleDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trModuleDocumentation() << "}\n";
for (const auto &gd : *Doxygen::groupLinkedMap)
{
if (!gd->isReference())
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!first)
{
beginRTFSection();
}
first=false;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << gd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << gd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
}
@@ -759,20 +782,20 @@ void RTFGenerator::endIndexSection(IndexSections is)
case isDirDocumentation:
{
bool first=true;
- t << "{\\tc \\v " << theTranslator->trDirDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trDirDocumentation() << "}\n";
for (const auto &dd : *Doxygen::dirLinkedMap)
{
if (dd->isLinkableInProject())
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!first)
{
beginRTFSection();
}
first=false;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << dd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << dd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
}
@@ -784,15 +807,35 @@ void RTFGenerator::endIndexSection(IndexSections is)
{
if (nd->isLinkableInProject() && !nd->isAlias())
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!first)
{
beginRTFSection();
}
first=false;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << nd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << nd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ }
+ }
+ }
+ break;
+ case isConceptDocumentation:
+ {
+ bool first=true;
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ if (cd->isLinkableInProject() && !cd->isAlias())
+ {
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ if (!first)
+ {
+ beginRTFSection();
+ }
+ first=false;
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << cd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
}
@@ -802,11 +845,11 @@ void RTFGenerator::endIndexSection(IndexSections is)
bool first=true;
if (fortranOpt)
{
- t << "{\\tc \\v " << theTranslator->trTypeDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trTypeDocumentation() << "}\n";
}
else
{
- t << "{\\tc \\v " << theTranslator->trClassDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trClassDocumentation() << "}\n";
}
for (const auto &cd : *Doxygen::classLinkedMap)
{
@@ -816,15 +859,15 @@ void RTFGenerator::endIndexSection(IndexSections is)
!cd->isAlias()
)
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!first)
{
beginRTFSection();
}
first=false;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << cd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << cd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
}
@@ -833,26 +876,26 @@ void RTFGenerator::endIndexSection(IndexSections is)
{
bool isFirst=TRUE;
- t << "{\\tc \\v " << theTranslator->trFileDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trFileDocumentation() << "}\n";
for (const auto &fn : *Doxygen::inputNameLinkedMap)
{
for (const auto &fd : *fn)
{
if (fd->isLinkableInProject())
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!isFirst)
{
beginRTFSection();
}
isFirst=FALSE;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << fd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << fd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
{
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"" << fd->getSourceFileBase() << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"" << fd->getSourceFileBase() << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
}
@@ -861,37 +904,37 @@ void RTFGenerator::endIndexSection(IndexSections is)
break;
case isExampleDocumentation:
{
- //t << "}\n";
+ //m_t << "}\n";
bool isFirst=true;
- t << "{\\tc \\v " << theTranslator->trExampleDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trExampleDocumentation() << "}\n";
for (const auto &pd : *Doxygen::exampleLinkedMap)
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!isFirst)
{
beginRTFSection();
}
isFirst=false;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << pd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << pd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
break;
case isPageDocumentation:
{
//#error "fix me in the same way as the latex index..."
- //t << "{\\tc \\v " << theTranslator->trPageDocumentation() << "}"<< endl;
- //t << "}"<< endl;
+ //m_t << "{\\tc \\v " << theTranslator->trPageDocumentation() << "}\n";
+ //m_t << "}\n";
//bool first=TRUE;
//for (const auto *pd : Doxygen::pageLinkedMap)
//{
// if (!pd->getGroupDef() && !pd->isReference())
// {
- // if (first) t << "\\par " << rtf_Style_Reset << endl;
- // t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- // t << pd->getOutputFileBase();
- // t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ // if (first) m_t << "\\par " << rtf_Style_Reset << "\n";
+ // m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ // m_t << pd->getOutputFileBase();
+ // m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
// first=FALSE;
// }
//}
@@ -899,39 +942,39 @@ void RTFGenerator::endIndexSection(IndexSections is)
break;
case isPageDocumentation2:
{
- t << "}";
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "}";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
}
break;
case isEndIndex:
beginRTFChapter();
- t << rtf_Style["Heading1"]->reference();
- t << theTranslator->trRTFGeneralIndex() << "\\par "<< endl;
- t << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trRTFGeneralIndex() << "}" << endl;
- t << "{\\field\\fldedit {\\*\\fldinst INDEX \\\\c2 \\\\*MERGEFORMAT}{\\fldrslt INDEX}}\n";
+ m_t << rtf_Style["Heading1"].reference();
+ m_t << theTranslator->trRTFGeneralIndex() << "\\par \n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trRTFGeneralIndex() << "}\n";
+ m_t << "{\\field\\fldedit {\\*\\fldinst INDEX \\\\c2 \\\\*MERGEFORMAT}{\\fldrslt INDEX}}\n";
break;
}
}
-void RTFGenerator::writePageLink(const char *name,bool first)
+void RTFGenerator::writePageLink(const QCString &name,bool first)
{
- if (first) t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << name;
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ if (first) m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << name;
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
void RTFGenerator::lastIndexPage()
{
- DBG_RTF(t <<"{\\comment Beginning Body of RTF Document}\n")
+ DBG_RTF(m_t << "{\\comment Beginning Body of RTF Document}\n")
// end page and setup for rest of document
- t <<"\\sect \\sbkpage \\pgndec \\pgnrestart\n";
- t <<"\\sect \\sectd \\sbknone\n";
+ m_t << "\\sect \\sbkpage \\pgndec \\pgnrestart\n";
+ m_t << "\\sect \\sectd \\sbknone\n";
// set new footer with arabic numbers
- t <<"{\\footer "<< rtf_Style["Footer"]->reference() << "{\\chpgn}}\n";
+ m_t << "{\\footer "<< rtf_Style["Footer"].reference() << "{\\chpgn}}\n";
}
@@ -939,37 +982,37 @@ void RTFGenerator::writeStyleInfo(int)
{
}
-void RTFGenerator::lineBreak(const char *)
+void RTFGenerator::lineBreak(const QCString &)
{
- DBG_RTF(t << "{\\comment (lineBreak)}" << endl)
- t << "\\par" << endl;
+ DBG_RTF(m_t << "{\\comment (lineBreak)}" << "\n")
+ m_t << "\\par\n";
m_omitParagraph = TRUE;
}
-void RTFGenerator::writeString(const char *text)
+void RTFGenerator::writeString(const QCString &text)
{
- t << text;
+ m_t << text;
}
void RTFGenerator::startIndexList()
{
- DBG_RTF(t << "{\\comment (startIndexList)}" << endl)
- t << "{" << endl;
- t << "\\par" << endl;
+ DBG_RTF(m_t << "{\\comment (startIndexList)}\n")
+ m_t << "{\n";
+ m_t << "\\par\n";
incrementIndentLevel();
- t << rtf_Style_Reset << rtf_LCList_DepthStyle() << endl;
+ m_t << rtf_Style_Reset << rtf_LCList_DepthStyle() << "\n";
m_omitParagraph = TRUE;
}
void RTFGenerator::endIndexList()
{
- DBG_RTF(t << "{\\comment (endIndexList)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endIndexList)}\n")
if (!m_omitParagraph)
{
- t << "\\par";
+ m_t << "\\par";
m_omitParagraph = TRUE;
}
- t << "}";
+ m_t << "}";
decrementIndentLevel();
}
@@ -977,8 +1020,8 @@ void RTFGenerator::endIndexList()
void RTFGenerator::startItemList()
{
newParagraph();
- DBG_RTF(t << "{\\comment (startItemList level=" << m_listLevel << ") }" << endl)
- t << "{";
+ DBG_RTF(m_t << "{\\comment (startItemList level=" << m_listLevel << ") }\n")
+ m_t << "{";
incrementIndentLevel();
rtf_listItemInfo[m_listLevel].isEnum = FALSE;
}
@@ -987,8 +1030,8 @@ void RTFGenerator::startItemList()
void RTFGenerator::endItemList()
{
newParagraph();
- DBG_RTF(t << "{\\comment (endItemList level=" << m_listLevel << ")}" << endl)
- t << "}";
+ DBG_RTF(m_t << "{\\comment (endItemList level=" << m_listLevel << ")}\n")
+ m_t << "}";
decrementIndentLevel();
m_omitParagraph = TRUE;
}
@@ -996,8 +1039,8 @@ void RTFGenerator::endItemList()
///*! start enumeration list */
//void RTFGenerator::startEnumList() // starts an enumeration list
//{
-// DBG_RTF(t << "{\\comment (startEnumList)}" << endl)
-// t << "{" << endl;
+// DBG_RTF(m_t << "{\\comment (startEnumList)}\n")
+// m_t << "{\n";
// incrementIndentLevel();
// rtf_listItemInfo[m_listLevel].isEnum = TRUE;
// rtf_listItemInfo[m_listLevel].number = 1;
@@ -1007,8 +1050,8 @@ void RTFGenerator::endItemList()
//void RTFGenerator::endEnumList()
//{
// newParagraph();
-// DBG_RTF(t << "{\\comment (endEnumList)}" << endl)
-// t << "}";
+// DBG_RTF(m_t << "{\\comment (endEnumList)}\n")
+// m_t << "}";
// decrementIndentLevel();
// m_omitParagraph = TRUE;
//}
@@ -1016,70 +1059,70 @@ void RTFGenerator::endItemList()
/*! write bullet or enum item */
void RTFGenerator::startItemListItem()
{
- DBG_RTF(t << "{\\comment (startItemListItem)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startItemListItem)}\n")
newParagraph();
- t << rtf_Style_Reset;
+ m_t << rtf_Style_Reset;
if (rtf_listItemInfo[m_listLevel].isEnum)
{
- t << rtf_EList_DepthStyle() << endl;
- t << rtf_listItemInfo[m_listLevel].number << ".\\tab ";
+ m_t << rtf_EList_DepthStyle() << "\n";
+ m_t << rtf_listItemInfo[m_listLevel].number << ".\\tab ";
rtf_listItemInfo[m_listLevel].number++;
}
else
{
- t << rtf_BList_DepthStyle() << endl;
+ m_t << rtf_BList_DepthStyle() << "\n";
}
m_omitParagraph = TRUE;
}
void RTFGenerator::endItemListItem()
{
- DBG_RTF(t << "{\\comment (endItemListItem)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endItemListItem)}\n")
}
-void RTFGenerator::startIndexItem(const char *,const char *)
+void RTFGenerator::startIndexItem(const QCString &,const QCString &)
{
- DBG_RTF(t << "{\\comment (startIndexItem)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startIndexItem)}\n")
if (!m_omitParagraph)
{
- t << "\\par" << endl;
+ m_t << "\\par\n";
m_omitParagraph = TRUE;
}
}
-void RTFGenerator::endIndexItem(const char *ref,const char *fn)
+void RTFGenerator::endIndexItem(const QCString &ref,const QCString &fn)
{
- DBG_RTF(t << "{\\comment (endIndexItem)}" << endl)
- if (!ref && fn)
+ DBG_RTF(m_t << "{\\comment (endIndexItem)}\n")
+ if (ref.isEmpty() && !fn.isEmpty())
{
- t << "\\tab ";
+ m_t << "\\tab ";
writeRTFReference(fn);
- t << endl;
+ m_t << "\n";
}
else
{
- t << endl;
+ m_t << "\n";
}
m_omitParagraph = TRUE;
}
-//void RTFGenerator::writeIndexFileItem(const char *,const char *text)
+//void RTFGenerator::writeIndexFileItem(const QCString &,const QCString &text)
//{
-// t << "\\item\\contentsline{section}{";
+// m_t << "\\item\\contentsline{section}{";
// docify(text);
-// t << "}{\\pageref{" << text << "}}" << endl;
+// m_t << "}{\\pageref{" << texm_t << "}}\n";
//}
-void RTFGenerator::startHtmlLink(const char *url)
+void RTFGenerator::startHtmlLink(const QCString &url)
{
if (Config_getBool(RTF_HYPERLINKS))
{
- t << "{\\field {\\*\\fldinst { HYPERLINK \"";
- t << url;
- t << "\" }{}";
- t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
+ m_t << "{\\field {\\*\\fldinst { HYPERLINK \"";
+ m_t << url;
+ m_t << "\" }{}";
+ m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
}
else
{
@@ -1091,7 +1134,7 @@ void RTFGenerator::endHtmlLink()
{
if (Config_getBool(RTF_HYPERLINKS))
{
- t << "}}}" << endl;
+ m_t << "}}}\n";
}
else
{
@@ -1099,85 +1142,85 @@ void RTFGenerator::endHtmlLink()
}
}
-//void RTFGenerator::writeMailLink(const char *url)
+//void RTFGenerator::writeMailLink(const QCString &url)
//{
// startTypewriter();
// docify(url);
// endTypewriter();
//}
-void RTFGenerator::writeStartAnnoItem(const char *,const char *f,
- const char *path,const char *name)
+void RTFGenerator::writeStartAnnoItem(const QCString &,const QCString &f,
+ const QCString &path,const QCString &name)
{
- DBG_RTF(t << "{\\comment (writeStartAnnoItem)}" << endl)
- t << "{\\b ";
- if (path) docify(path);
- if (f && Config_getBool(RTF_HYPERLINKS))
+ DBG_RTF(m_t << "{\\comment (writeStartAnnoItem)}\n")
+ m_t << "{\\b ";
+ if (!path.isEmpty()) docify(path);
+ if (!f.isEmpty() && Config_getBool(RTF_HYPERLINKS))
{
- t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
- t << rtfFormatBmkStr(f);
- t << "\" }{}";
- t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
+ m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
+ m_t << rtfFormatBmkStr(f);
+ m_t << "\" }{}";
+ m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
docify(name);
- t << "}}}" << endl;
+ m_t << "}}}\n";
}
else
{
docify(name);
}
- t << "} ";
+ m_t << "} ";
}
-void RTFGenerator::writeEndAnnoItem(const char *name)
+void RTFGenerator::writeEndAnnoItem(const QCString &name)
{
- DBG_RTF(t << "{\\comment (writeEndAnnoItem)}" << endl)
- if (name)
+ DBG_RTF(m_t << "{\\comment (writeEndAnnoItem)}\n")
+ if (!name.isEmpty())
{
- t << "\\tab ";
+ m_t << "\\tab ";
writeRTFReference(name);
- t << endl;
+ m_t << "\n";
}
else
{
- t << endl;
+ m_t << "\n";
}
newParagraph();
}
void RTFGenerator::startIndexKey()
{
- DBG_RTF(t << "{\\comment (startIndexKey)}" << endl)
- t << "{\\b ";
+ DBG_RTF(m_t << "{\\comment (startIndexKey)}\n")
+ m_t << "{\\b ";
}
void RTFGenerator::endIndexKey()
{
- DBG_RTF(t << "{\\comment (endIndexKey)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endIndexKey)}\n")
}
void RTFGenerator::startIndexValue(bool hasBrief)
{
- DBG_RTF(t << "{\\comment (startIndexValue)}" << endl)
- t << " ";
- if (hasBrief) t << "(";
+ DBG_RTF(m_t << "{\\comment (startIndexValue)}\n")
+ m_t << " ";
+ if (hasBrief) m_t << "(";
}
-void RTFGenerator::endIndexValue(const char *name,bool hasBrief)
+void RTFGenerator::endIndexValue(const QCString &name,bool hasBrief)
{
- DBG_RTF(t << "{\\comment (endIndexValue)}" << endl)
- if (hasBrief) t << ")";
- t << "} ";
- if (name)
+ DBG_RTF(m_t << "{\\comment (endIndexValue)}\n")
+ if (hasBrief) m_t << ")";
+ m_t << "} ";
+ if (!name.isEmpty())
{
- t << "\\tab ";
+ m_t << "\\tab ";
writeRTFReference(name);
- t << endl;
+ m_t << "\n";
}
else
{
- t << endl;
+ m_t << "\n";
}
m_omitParagraph=FALSE;
newParagraph();
@@ -1186,128 +1229,128 @@ void RTFGenerator::endIndexValue(const char *name,bool hasBrief)
void RTFGenerator::startSubsection()
{
//beginRTFSubSection();
- t <<"\n";
- DBG_RTF(t << "{\\comment Begin SubSection}\n")
- t << rtf_Style_Reset;
- t << rtf_Style["Heading3"]->reference() << "\n";
+ m_t << "\n";
+ DBG_RTF(m_t << "{\\comment Begin SubSection}\n")
+ m_t << rtf_Style_Reset;
+ m_t << rtf_Style["Heading3"].reference() << "\n";
}
void RTFGenerator::endSubsection()
{
newParagraph();
- t << rtf_Style_Reset << endl;
+ m_t << rtf_Style_Reset << "\n";
}
void RTFGenerator::startSubsubsection()
{
//beginRTFSubSubSection();
- t << "\n";
- DBG_RTF(t << "{\\comment Begin SubSubSection}\n")
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_Style["Heading4"]->reference() << "\n";
+ m_t << "\n";
+ DBG_RTF(m_t << "{\\comment Begin SubSubSection}\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_Style["Heading4"].reference() << "\n";
}
void RTFGenerator::endSubsubsection()
{
newParagraph();
- t << "}" << endl;
+ m_t << "}\n";
}
-//void RTFGenerator::writeClassLink(const char *,const char *,
-// const char *,const char *name)
+//void RTFGenerator::writeClassLink(const QCString &,const QCString &,
+// const QCString &,const QCString &name)
//{
-// t << "{\\bf ";
+// m_t << "{\\bf ";
// docify(name);
-// t << "}";
+// m_t << "}";
//}
//void RTFGenerator::startTable(bool,int colNumbers)
//{
-// DBG_RTF(t << "{\\comment startTable}\n";)
+// DBG_RTF(m_t << "{\\comment startTable}\n";)
// m_numCols=colNumbers;
-// t << "\\par\n";
+// m_t << "\\par\n";
//}
//
//void RTFGenerator::endTable(bool hasCaption)
//{
-// DBG_RTF(t << "{\\comment endTable}\n";)
+// DBG_RTF(m_t << "{\\comment endTable}\n";)
// if (!hasCaption)
-// t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n";
-// t << "\\pard\n" << endl;
+// m_t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n";
+// m_t << "\\pard\n\n";
//}
//
//void RTFGenerator::startCaption()
//{
-// DBG_RTF(t << "{\\comment startCaption}\n";)
+// DBG_RTF(m_t << "{\\comment startCaption}\n";)
// endTableRow();
-// t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 \\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 \\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 \\trbrdrv\\brdrs\\brdrw10" << endl;
-// t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 \\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb \\cellx"<<rtf_pageWidth<<"\\pard \\qc\\nowidctlpar\\widctlpar\\intbl\\adjustright " << endl;
+// m_t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 \\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 \\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 \\trbrdrv\\brdrs\\brdrw10\n";
+// m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 \\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb \\cellx"<<rtf_pageWidth<<"\\pard \\qc\\nowidctlpar\\widctlpar\\intbl\\adjustright \n";
// nextTableColumn();
//}
//
//void RTFGenerator::endCaption()
//{
-// DBG_RTF(t << "{\\comment endCaption}\n";)
+// DBG_RTF(m_t << "{\\comment endCaption}\n";)
// endTableColumn();
// endTableRow();
//}
//
//void RTFGenerator::nextTableRow()
//{
-// DBG_RTF(t << "{\\comment nextTableRow}\n";)
+// DBG_RTF(m_t << "{\\comment nextTableRow}\n";)
// ASSERT(m_numCols>0 && m_numCols<25);
// uint columnWidth=rtf_pageWidth/m_numCols;
-// t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 "
+// m_t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 "
// "\\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 "
// "\\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 "
-// "\\trbrdrv\\brdrs\\brdrw10 "<<endl;
+// "\\trbrdrv\\brdrs\\brdrw10 \n";
// for (int i=0;i<m_numCols;i++)
// {
-// t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 "
+// m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 "
// "\\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb "
-// "\\cellx" << (i*columnWidth) << endl;
+// "\\cellx" << (i*columnWidth) << "\n";
// }
-// t << "\\pard \\widctlpar\\intbl\\adjustright\n{";
+// m_t << "\\pard \\widctlpar\\intbl\\adjustright\n{";
//}
//
//void RTFGenerator::endTableRow()
//{
-// DBG_RTF(t << "{\\comment endTableRow}\n";)
-// t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n";
+// DBG_RTF(m_t << "{\\comment endTableRow}\n";)
+// m_t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n";
//}
//
//void RTFGenerator::nextTableColumn()
//{
-// DBG_RTF(t << "{\\comment nextTableColumn}\n";)
-// t << "{ ";
+// DBG_RTF(m_t << "{\\comment nextTableColumn}\n";)
+// m_t << "{ ";
//}
//
//void RTFGenerator::endTableColumn()
//{
-// DBG_RTF(t << "{\\comment endTableColumn}\n";)
-// t << " \\cell }";
+// DBG_RTF(m_t << "{\\comment endTableColumn}\n";)
+// m_t << " \\cell }";
//}
//
-void RTFGenerator::startTextLink(const char *f,const char *anchor)
+void RTFGenerator::startTextLink(const QCString &f,const QCString &anchor)
{
if (Config_getBool(RTF_HYPERLINKS))
{
QCString ref;
- if (f)
+ if (!f.isEmpty())
{
ref+=f;
}
- if (anchor)
+ if (!anchor.isEmpty())
{
ref+='_';
ref+=anchor;
}
- t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
- t << rtfFormatBmkStr(ref);
- t << "\" }{}";
- t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
+ m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
+ m_t << rtfFormatBmkStr(ref);
+ m_t << "\" }{}";
+ m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
}
}
@@ -1315,34 +1358,34 @@ void RTFGenerator::endTextLink()
{
if (Config_getBool(RTF_HYPERLINKS))
{
- t << "}}}" << endl;
+ m_t << "}}}\n";
}
}
-void RTFGenerator::writeObjectLink(const char *ref, const char *f,
- const char *anchor, const char *text)
+void RTFGenerator::writeObjectLink(const QCString &ref, const QCString &f,
+ const QCString &anchor, const QCString &text)
{
- if (!ref && Config_getBool(RTF_HYPERLINKS))
+ if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
{
QCString refName;
- if (f)
+ if (!f.isEmpty())
{
refName+=f;
}
- if (anchor)
+ if (!anchor.isEmpty())
{
refName+='_';
refName+=anchor;
}
- t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
- t << rtfFormatBmkStr(refName);
- t << "\" }{}";
- t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
+ m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
+ m_t << rtfFormatBmkStr(refName);
+ m_t << "\" }{}";
+ m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
docify(text);
- t << "}}}" << endl;
+ m_t << "}}}\n";
}
else
{
@@ -1354,52 +1397,52 @@ void RTFGenerator::writeObjectLink(const char *ref, const char *f,
void RTFGenerator::startPageRef()
{
- t << " (";
+ m_t << " (";
startEmphasis();
}
-void RTFGenerator::endPageRef(const char *clname, const char *anchor)
+void RTFGenerator::endPageRef(const QCString &clname, const QCString &anchor)
{
QCString ref;
- if (clname)
+ if (!clname.isEmpty())
{
ref+=clname;
}
- if (anchor)
+ if (!anchor.isEmpty())
{
ref+='_';
ref+=anchor;
}
writeRTFReference(ref);
endEmphasis();
- t << ")";
+ m_t << ")";
}
-void RTFGenerator::writeCodeLink(const char *ref,const char *f,
- const char *anchor,const char *name,
- const char *)
+void RTFGenerator::writeCodeLink(const QCString &ref,const QCString &f,
+ const QCString &anchor,const QCString &name,
+ const QCString &)
{
- if (!ref && Config_getBool(RTF_HYPERLINKS))
+ if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
{
QCString refName;
- if (f)
+ if (!f.isEmpty())
{
refName+=f;
}
- if (anchor)
+ if (!anchor.isEmpty())
{
refName+='_';
refName+=anchor;
}
- t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
- t << rtfFormatBmkStr(refName);
- t << "\" }{}";
- t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
+ m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
+ m_t << rtfFormatBmkStr(refName);
+ m_t << "\" }{}";
+ m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
codify(name);
- t << "}}}" << endl;
+ m_t << "}}}\n";
}
else
{
@@ -1407,27 +1450,27 @@ void RTFGenerator::writeCodeLink(const char *ref,const char *f,
}
}
-void RTFGenerator::startTitleHead(const char *)
+void RTFGenerator::startTitleHead(const QCString &)
{
- DBG_RTF(t <<"{\\comment startTitleHead}" << endl)
+ DBG_RTF(m_t << "{\\comment startTitleHead}\n")
// beginRTFSection();
- t << rtf_Style_Reset << rtf_Style["Heading2"]->reference() << endl;
+ m_t << rtf_Style_Reset << rtf_Style["Heading2"].reference() << "\n";
}
-void RTFGenerator::endTitleHead(const char *fileName,const char *name)
+void RTFGenerator::endTitleHead(const QCString &fileName,const QCString &name)
{
- DBG_RTF(t <<"{\\comment endTitleHead}" << endl)
- t << "\\par " << rtf_Style_Reset << endl;
- if (name)
+ DBG_RTF(m_t << "{\\comment endTitleHead}\n")
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ if (!name.isEmpty())
{
// make table of contents entry
- t << "{\\tc\\tcl2 \\v ";
+ m_t << "{\\tc\\tcl2 \\v ";
docify(name);
- t << "}" << endl;
+ m_t << "}\n";
// make an index entry
- addIndexItem(name,0);
+ addIndexItem(name,QCString());
//if (name)
//{
@@ -1436,14 +1479,14 @@ void RTFGenerator::endTitleHead(const char *fileName,const char *name)
//
//if (Config_getBool(RTF_HYPERLINKS) && fileName)
//{
- writeAnchor(fileName,0);
+ writeAnchor(fileName,QCString());
//}
}
}
void RTFGenerator::startTitle()
{
- DBG_RTF(t <<"{\\comment startTitle}" << endl)
+ DBG_RTF(m_t << "{\\comment startTitle}\n")
if (Config_getBool(COMPACT_RTF))
beginRTFSection();
else
@@ -1452,222 +1495,222 @@ void RTFGenerator::startTitle()
void RTFGenerator::startGroupHeader(int extraIndent)
{
- DBG_RTF(t <<"{\\comment startGroupHeader}" << endl)
+ DBG_RTF(m_t << "{\\comment startGroupHeader}\n")
//newParagraph();
- t << rtf_Style_Reset;
+ m_t << rtf_Style_Reset;
if (extraIndent==2)
{
- t << rtf_Style["Heading5"]->reference();
+ m_t << rtf_Style["Heading5"].reference();
}
else if (extraIndent==1)
{
- t << rtf_Style["Heading4"]->reference();
+ m_t << rtf_Style["Heading4"].reference();
}
else // extraIndent==0
{
- t << rtf_Style["Heading3"]->reference();
+ m_t << rtf_Style["Heading3"].reference();
}
- t << endl;
+ m_t << "\n";
}
void RTFGenerator::endGroupHeader(int)
{
- DBG_RTF(t <<"{\\comment endGroupHeader}" << endl)
- t << "\\par" << endl;
- t << rtf_Style_Reset << endl;
+ DBG_RTF(m_t << "{\\comment endGroupHeader}\n")
+ m_t << "\\par\n";
+ m_t << rtf_Style_Reset << "\n";
}
-void RTFGenerator::startMemberDoc(const char *clname,
- const char *memname,
- const char *,
- const char *,
+void RTFGenerator::startMemberDoc(const QCString &clname,
+ const QCString &memname,
+ const QCString &,
+ const QCString &,
int,
int,
bool showInline)
{
- DBG_RTF(t << "{\\comment startMemberDoc}" << endl)
- if (memname && memname[0]!='@')
+ DBG_RTF(m_t << "{\\comment startMemberDoc}\n")
+ if (!memname.isEmpty() && memname[0]!='@')
{
addIndexItem(memname,clname);
addIndexItem(clname,memname);
}
- t << rtf_Style_Reset << rtf_Style[showInline ? "Heading5" : "Heading4"]->reference();
+ m_t << rtf_Style_Reset << rtf_Style[showInline ? "Heading5" : "Heading4"].reference();
//styleStack.push(rtf_Style_Heading4);
- t << "{" << endl;
- //printf("RTFGenerator::startMemberDoc() '%s'\n",rtf_Style["Heading4"]->reference());
+ m_t << "{\n";
+ //printf("RTFGenerator::startMemberDoc() '%s'\n",rtf_Style["Heading4"].reference());
startBold();
- t << endl;
+ m_t << "\n";
}
void RTFGenerator::endMemberDoc(bool)
{
- DBG_RTF(t << "{\\comment endMemberDoc}" << endl)
- //const char *style = styleStack.pop();
+ DBG_RTF(m_t << "{\\comment endMemberDoc}\n")
+ //const QCString &style = styleStack.pop();
//printf("RTFGenerator::endMemberDoc() '%s'\n",style);
- //ASSERT(style==rtf_Style["Heading4"]->reference());
+ //ASSERT(style==rtf_Style["Heading4"].reference());
endBold();
- t << "}" << endl;
+ m_t << "}\n";
newParagraph();
}
-void RTFGenerator::startDoxyAnchor(const char *,const char *,
- const char *,const char *,
- const char *
+void RTFGenerator::startDoxyAnchor(const QCString &,const QCString &,
+ const QCString &,const QCString &,
+ const QCString &
)
{
- DBG_RTF(t << "{\\comment startDoxyAnchor}" << endl)
+ DBG_RTF(m_t << "{\\comment startDoxyAnchor}\n")
}
-void RTFGenerator::endDoxyAnchor(const char *fName,const char *anchor)
+void RTFGenerator::endDoxyAnchor(const QCString &fName,const QCString &anchor)
{
QCString ref;
- if (fName)
+ if (!fName.isEmpty())
{
ref+=fName;
}
- if (anchor)
+ if (!anchor.isEmpty())
{
ref+='_';
ref+=anchor;
}
- DBG_RTF(t << "{\\comment endDoxyAnchor}" << endl)
- t << "{\\bkmkstart ";
- t << rtfFormatBmkStr(ref);
- t << "}" << endl;
- t << "{\\bkmkend ";
- t << rtfFormatBmkStr(ref);
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment endDoxyAnchor}\n")
+ m_t << "{\\bkmkstart ";
+ m_t << rtfFormatBmkStr(ref);
+ m_t << "}\n";
+ m_t << "{\\bkmkend ";
+ m_t << rtfFormatBmkStr(ref);
+ m_t << "}\n";
}
-//void RTFGenerator::writeLatexLabel(const char *clName,const char *anchor)
+//void RTFGenerator::writeLatexLabel(const QCString &clName,const QCString &anchor)
//{
// writeDoxyAnchor(0,clName,anchor,0);
//}
-void RTFGenerator::addIndexItem(const char *s1,const char *s2)
+void RTFGenerator::addIndexItem(const QCString &s1,const QCString &s2)
{
- if (s1)
+ if (!s1.isEmpty())
{
- t << "{\\xe \\v ";
+ m_t << "{\\xe \\v ";
docify(s1);
- if (s2)
+ if (!s2.isEmpty())
{
- t << "\\:";
+ m_t << "\\:";
docify(s2);
}
- t << "}" << endl;
+ m_t << "}\n";
}
}
void RTFGenerator::startIndent()
{
incrementIndentLevel();
- DBG_RTF(t << "{\\comment (startIndent) }" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_CList_DepthStyle() << endl;
+ DBG_RTF(m_t << "{\\comment (startIndent) }\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_CList_DepthStyle() << "\n";
}
void RTFGenerator::endIndent()
{
- t << "}" << endl;
+ m_t << "}\n";
decrementIndentLevel();
}
void RTFGenerator::startDescription()
{
- DBG_RTF(t << "{\\comment (startDescription)}" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ DBG_RTF(m_t << "{\\comment (startDescription)}" << "\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
}
void RTFGenerator::endDescription()
{
- DBG_RTF(t << "{\\comment (endDescription)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endDescription)}" << "\n")
newParagraph();
- t << "}";
+ m_t << "}";
}
void RTFGenerator::startDescItem()
{
newParagraph();
- DBG_RTF(t << "{\\comment (startDescItem)}" << endl)
- t << "{\\b ";
+ DBG_RTF(m_t << "{\\comment (startDescItem)}\n")
+ m_t << "{\\b ";
}
void RTFGenerator::endDescItem()
{
- DBG_RTF(t << "{\\comment (endDescItem)}" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment (endDescItem)}\n")
+ m_t << "}\n";
newParagraph();
}
-void RTFGenerator::startMemberDescription(const char *,const char *,bool)
+void RTFGenerator::startMemberDescription(const QCString &,const QCString &,bool)
{
- DBG_RTF(t << "{\\comment (startMemberDescription)}" << endl)
- t << "{" << endl;
+ DBG_RTF(m_t << "{\\comment (startMemberDescription)}\n")
+ m_t << "{\n";
incrementIndentLevel();
- t << rtf_Style_Reset << rtf_CList_DepthStyle();
+ m_t << rtf_Style_Reset << rtf_CList_DepthStyle();
startEmphasis();
}
void RTFGenerator::endMemberDescription()
{
- DBG_RTF(t << "{\\comment (endMemberDescription)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endMemberDescription)}\n")
endEmphasis();
//newParagraph();
decrementIndentLevel();
- t << "\\par";
- t << "}" << endl;
+ m_t << "\\par";
+ m_t << "}\n";
m_omitParagraph = TRUE;
}
void RTFGenerator::startDescList(SectionTypes)
{
- DBG_RTF(t << "{\\comment (startDescList)}" << endl)
- t << "{"; // ends at endDescList
- t << "{"; // ends at endDescTitle
+ DBG_RTF(m_t << "{\\comment (startDescList)}\n")
+ m_t << "{"; // ends at endDescList
+ m_t << "{"; // ends at endDescTitle
startBold();
newParagraph();
}
//void RTFGenerator::endDescTitle()
//{
-// DBG_RTF(t << "{\\comment (endDescTitle) }" << endl)
+// DBG_RTF(m_t << "{\\comment (endDescTitle) }\n")
// endBold();
-// t << "}";
+// m_t << "}";
// newParagraph();
// incrementIndentLevel();
-// t << rtf_Style_Reset << rtf_DList_DepthStyle();
+// m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
//}
void RTFGenerator::startDescForItem()
{
- DBG_RTF(t << "{\\comment (startDescForItem) }" << endl)
+ DBG_RTF(m_t << "{\\comment (startDescForItem) }\n")
}
void RTFGenerator::endDescForItem()
{
- DBG_RTF(t << "{\\comment (endDescForItem) }" << endl)
+ DBG_RTF(m_t << "{\\comment (endDescForItem) }\n")
}
//void RTFGenerator::endDescList()
//{
-// DBG_RTF(t << "{\\comment (endDescList)}" << endl)
+// DBG_RTF(m_t << "{\\comment (endDescList)}\n")
// newParagraph();
// decrementIndentLevel();
// m_omitParagraph = TRUE;
-// t << "}";
+// m_t << "}";
//}
-void RTFGenerator::startSection(const char *,const char *title,SectionType type)
+void RTFGenerator::startSection(const QCString &,const QCString &title,SectionType type)
{
- DBG_RTF(t << "{\\comment (startSection)}" << endl)
- t << "{";
- t<< rtf_Style_Reset;
+ DBG_RTF(m_t << "{\\comment (startSection)}\n")
+ m_t << "{";
+ m_t << rtf_Style_Reset;
int num=4;
switch(type)
{
@@ -1681,25 +1724,25 @@ void RTFGenerator::startSection(const char *,const char *title,SectionType type)
QCString heading;
heading.sprintf("Heading%d",num);
// set style
- t << rtf_Style[heading]->reference();
+ m_t << rtf_Style[heading.str()].reference();
// make table of contents entry
- t << "{\\tc\\tcl" << num << " \\v ";
+ m_t << "{\\tc\\tcl" << num << " \\v ";
docify(title);
- t << "}" << endl;
+ m_t << "}\n";
}
-void RTFGenerator::endSection(const char *lab,SectionType)
+void RTFGenerator::endSection(const QCString &lab,SectionType)
{
- DBG_RTF(t << "{\\comment (endSection)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endSection)}\n")
// make bookmark
m_omitParagraph=FALSE;
newParagraph();
- writeAnchor(0,lab);
- t << "}";
+ writeAnchor(QCString(),lab);
+ m_t << "}";
}
-//void RTFGenerator::writeSectionRef(const char *ref,const char *,
-// const char *lab,const char *title)
+//void RTFGenerator::writeSectionRef(const QCString &ref,const QCString &,
+// const QCString &lab,const QCString &title)
//{
// if (ref)
// {
@@ -1710,24 +1753,24 @@ void RTFGenerator::endSection(const char *lab,SectionType)
// startBold();
// docify(title);
// endBold();
-// t << " (";
+// m_t << " (";
// docify(theTranslator->trPageAbbreviation());
// writeRTFReference(lab);
-// t << ")" << endl;
+// m_t << ")\n";
// }
//}
//
-//void RTFGenerator::writeSectionRefItem(const char *,const char *lab,
-// const char *title)
+//void RTFGenerator::writeSectionRefItem(const QCString &,const QCString &lab,
+// const QCString &title)
//{
// docify(title);
-// t << "\\tab";
+// m_t << "\\tab";
// writeRTFReference(lab);
-// t << endl;
+// m_t << "\n";
//}
//
-//void RTFGenerator::writeSectionRefAnchor(const char *name,const char *lab,
-// const char *title)
+//void RTFGenerator::writeSectionRefAnchor(const QCString &name,const QCString &lab,
+// const QCString &title)
//{
// writeSectionRef(name,lab,title);
//}
@@ -1740,11 +1783,11 @@ void RTFGenerator::endSection(const char *lab,SectionType)
// return s;
//}
-void RTFGenerator::docify(const char *str)
+void RTFGenerator::docify(const QCString &str)
{
- if (str)
+ if (!str.isEmpty())
{
- const unsigned char *p=(const unsigned char *)str;
+ const unsigned char *p=(const unsigned char *)str.data();
unsigned char c;
//unsigned char pc='\0';
while (*p)
@@ -1755,28 +1798,28 @@ void RTFGenerator::docify(const char *str)
#if 0
if ( MultiByte )
{
- t << getMultiByte( c );
+ m_t << getMultiByte( c );
MultiByte = FALSE;
continue;
}
if ( c >= 0x80 )
{
MultiByte = TRUE;
- t << getMultiByte( c );
+ m_t << getMultiByte( c );
continue;
}
#endif
switch (c)
{
- case '{': t << "\\{"; break;
- case '}': t << "\\}"; break;
- case '\\': t << "\\\\"; break;
+ case '{': m_t << "\\{"; break;
+ case '}': m_t << "\\}"; break;
+ case '\\': m_t << "\\\\"; break;
default:
{
// see if we can insert an hyphenation hint
- //if (isupper(c) && islower(pc) && !insideTabbing) t << "\\-";
- t << (char)c;
+ //if (isupper(c) && islower(pc) && !insideTabbing) m_t << "\\-";
+ m_t << (char)c;
}
}
//pc = c;
@@ -1785,14 +1828,14 @@ void RTFGenerator::docify(const char *str)
}
}
-void RTFGenerator::codify(const char *str)
+void RTFGenerator::codify(const QCString &str)
{
// note that RTF does not have a "verbatim", so "\n" means
// nothing... add a "newParagraph()";
//static char spaces[]=" ";
- if (str)
+ if (!str.isEmpty())
{
- const unsigned char *p=(const unsigned char *)str;
+ const unsigned char *p=(const unsigned char *)str.data();
unsigned char c;
int spacesToNextTabStop;
@@ -1805,16 +1848,16 @@ void RTFGenerator::codify(const char *str)
switch(c)
{
case '\t': spacesToNextTabStop = Config_getInt(TAB_SIZE) - (m_col%Config_getInt(TAB_SIZE));
- t << Doxygen::spaces.left(spacesToNextTabStop);
+ m_t << Doxygen::spaces.left(spacesToNextTabStop);
m_col+=spacesToNextTabStop;
break;
case '\n': newParagraph();
- t << '\n'; m_col=0;
+ m_t << '\n'; m_col=0;
break;
- case '{': t << "\\{"; m_col++; break;
- case '}': t << "\\}"; m_col++; break;
- case '\\': t << "\\\\"; m_col++; break;
- default: p=(const unsigned char *)writeUtf8Char(t,(const char *)p-1); m_col++; break;
+ case '{': m_t << "\\{"; m_col++; break;
+ case '}': m_t << "\\}"; m_col++; break;
+ case '\\': m_t << "\\\\"; m_col++; break;
+ default: p=(const unsigned char *)writeUTF8Char(m_t,(const char *)p-1); m_col++; break;
}
}
}
@@ -1830,123 +1873,123 @@ void RTFGenerator::writeChar(char c)
void RTFGenerator::startClassDiagram()
{
- DBG_RTF(t <<"{\\comment startClassDiagram }" << endl)
+ DBG_RTF(m_t << "{\\comment startClassDiagram }\n")
}
void RTFGenerator::endClassDiagram(const ClassDiagram &d,
- const char *fileName,const char *)
+ const QCString &fileName,const QCString &)
{
newParagraph();
// create a png file
- d.writeImage(t,dir(),m_relPath,fileName,FALSE);
+ d.writeImage(m_t,dir(),m_relPath,fileName,FALSE);
// display the file
- t << "{" << endl;
- t << rtf_Style_Reset << endl;
- t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
- t << fileName << ".png\"";
- t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
- t << "}" << endl;
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
+ m_t << fileName << ".png\"";
+ m_t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+ m_t << "}\n";
}
-//void RTFGenerator::writeFormula(const char *,const char *text)
+//void RTFGenerator::writeFormula(const QCString &,const QCString &text)
//{
-// t << text;
+// m_t << text;
//}
-void RTFGenerator::startMemberItem(const char *,int,const char *)
+void RTFGenerator::startMemberItem(const QCString &,int,const QCString &)
{
- DBG_RTF(t <<"{\\comment startMemberItem }" << endl)
- t << rtf_Style_Reset << rtf_BList_DepthStyle() << endl; // set style to appropriate depth
+ DBG_RTF(m_t << "{\\comment startMemberItem }\n")
+ m_t << rtf_Style_Reset << rtf_BList_DepthStyle() << "\n"; // set style to appropriate depth
}
void RTFGenerator::endMemberItem()
{
- DBG_RTF(t <<"{\\comment endMemberItem }" << endl)
+ DBG_RTF(m_t << "{\\comment endMemberItem }\n")
newParagraph();
}
-void RTFGenerator::writeAnchor(const char *fileName,const char *name)
+void RTFGenerator::writeAnchor(const QCString &fileName,const QCString &name)
{
QCString anchor;
- if (fileName)
+ if (!fileName.isEmpty())
{
anchor+=fileName;
}
- if (fileName && name)
+ if (!fileName.isEmpty() && !name.isEmpty())
{
anchor+='_';
}
- if (name)
+ if (!name.isEmpty())
{
anchor+=name;
}
- DBG_RTF(t <<"{\\comment writeAnchor (" << anchor << ")}" << endl)
- t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}" << endl;
- t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}" << endl;
+ DBG_RTF(m_t << "{\\comment writeAnchor (" << anchor << ")}\n")
+ m_t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}\n";
+ m_t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}\n";
}
-void RTFGenerator::writeRTFReference(const char *label)
+void RTFGenerator::writeRTFReference(const QCString &label)
{
- t << "{\\field\\fldedit {\\*\\fldinst PAGEREF ";
- t << rtfFormatBmkStr(label);
- t << " \\\\*MERGEFORMAT}{\\fldrslt pagenum}}";
+ m_t << "{\\field\\fldedit {\\*\\fldinst PAGEREF ";
+ m_t << rtfFormatBmkStr(label);
+ m_t << " \\\\*MERGEFORMAT}{\\fldrslt pagenum}}";
}
-void RTFGenerator::startCodeFragment(const char *)
+void RTFGenerator::startCodeFragment(const QCString &)
{
- DBG_RTF(t << "{\\comment (startCodeFragment) }" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_Code_DepthStyle();
+ DBG_RTF(m_t << "{\\comment (startCodeFragment) }\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_Code_DepthStyle();
}
-void RTFGenerator::endCodeFragment(const char *)
+void RTFGenerator::endCodeFragment(const QCString &)
{
endCodeLine();
- DBG_RTF(t << "{\\comment (endCodeFragment) }" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment (endCodeFragment) }\n")
+ m_t << "}\n";
m_omitParagraph = TRUE;
}
void RTFGenerator::writeNonBreakableSpace(int)
{
- t << "\\~ ";
+ m_t << "\\~ ";
}
void RTFGenerator::startMemberList()
{
- t << endl;
- DBG_RTF(t << "{\\comment (startMemberList) }" << endl)
- t << "{" << endl;
+ m_t << "\n";
+ DBG_RTF(m_t << "{\\comment (startMemberList) }\n")
+ m_t << "{\n";
#ifdef DELETEDCODE
if (!insideTabbing)
- t << "\\begin{CompactItemize}" << endl;
+ m_t << "\\begin{CompactItemize}\n";
#endif
}
void RTFGenerator::endMemberList()
{
- DBG_RTF(t << "{\\comment (endMemberList) }" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment (endMemberList) }\n")
+ m_t << "}\n";
#ifdef DELETEDCODE
if (!insideTabbing)
- t << "\\end{CompactItemize}" << endl;
+ m_t << "\\end{CompactItemize}\n";
#endif
}
-//void RTFGenerator::startImage(const char *name,const char *,bool)
+//void RTFGenerator::startImage(const QCString &name,const QCString &,bool)
//{
// newParagraph();
-// t << "{" << endl;
-// t << rtf_Style_Reset << endl;
-// t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";
-// t << name;
-// t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
-// t << "}" << endl;
+// m_t << "{\n";
+// m_t << rtf_Style_Reset << "\n";
+// m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";
+// m_t << name;
+// m_t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+// m_t << "}\n";
//}
//
//void RTFGenerator::endImage(bool)
@@ -1954,7 +1997,7 @@ void RTFGenerator::endMemberList()
// // not yet implemented
//}
//
-//void RTFGenerator::startDotFile(const char *name,bool)
+//void RTFGenerator::startDotFile(const QCString &name,bool)
//{
// QCString baseName=name;
// int i;
@@ -1965,12 +2008,12 @@ void RTFGenerator::endMemberList()
// QCString outDir = Config_getString(RTF_OUTPUT);
// writeDotGraphFromFile(name,outDir,baseName,BITMAP);
// newParagraph();
-// t << "{" << endl;
-// t << rtf_Style_Reset << endl;
-// t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";
-// t << outDir << "\\" << baseName;
-// t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
-// t << "}" << endl;
+// m_t << "{\n";
+// m_t << rtf_Style_Reset << "\n";
+// m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";
+// m_t << outDir << "\\" << baseName;
+// m_t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+// m_t << "}\n";
//}
//
//void RTFGenerator::endDotFile(bool)
@@ -1978,38 +2021,38 @@ void RTFGenerator::endMemberList()
// // not yet implemented
//}
//
-void RTFGenerator::startDescTable(const char *title)
+void RTFGenerator::startDescTable(const QCString &title)
{
- DBG_RTF(t << "{\\comment (startDescTable) }" << endl)
- t << "{\\par" << endl;
- t << "{" << rtf_Style["Heading5"]->reference() << endl;
+ DBG_RTF(m_t << "{\\comment (startDescTable) }\n")
+ m_t << "{\\par\n";
+ m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
docify(title);
- t << ":\\par}" << endl;
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
- t << "\\trowd \\trgaph108\\trleft426\\tblind426"
+ m_t << ":\\par}\n";
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ m_t << "\\trowd \\trgaph108\\trleft426\\tblind426"
"\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrl\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 "
- "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< endl;
+ "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 \n";
int i,columnPos[2] = { 25, 100 };
for (i=0;i<2;i++)
{
- t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
+ m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 "
"\\cltxlrtb "
- "\\cellx" << (rtf_pageWidth*columnPos[i]/100) << endl;
+ "\\cellx" << (rtf_pageWidth*columnPos[i]/100) << "\n";
}
- t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
+ m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
}
void RTFGenerator::endDescTable()
{
- DBG_RTF(t << "{\\comment (endDescTable)}" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment (endDescTable)}\n")
+ m_t << "}\n";
}
void RTFGenerator::startDescTableRow()
@@ -2022,26 +2065,26 @@ void RTFGenerator::endDescTableRow()
void RTFGenerator::startDescTableTitle()
{
- DBG_RTF(t << "{\\comment (startDescTableTitle) }" << endl)
- t << "{\\qr ";
+ DBG_RTF(m_t << "{\\comment (startDescTableTitle) }\n")
+ m_t << "{\\qr ";
}
void RTFGenerator::endDescTableTitle()
{
- DBG_RTF(t << "{\\comment (endDescTableTitle) }" << endl)
- t << "\\cell }";
+ DBG_RTF(m_t << "{\\comment (endDescTableTitle) }\n")
+ m_t << "\\cell }";
}
void RTFGenerator::startDescTableData()
{
- DBG_RTF(t << "{\\comment (startDescTableData) }" << endl)
- t << "{";
+ DBG_RTF(m_t << "{\\comment (startDescTableData) }\n")
+ m_t << "{";
}
void RTFGenerator::endDescTableData()
{
- DBG_RTF(t << "{\\comment (endDescTableData) }" << endl)
- t << "\\cell }{\\row }" << endl;
+ DBG_RTF(m_t << "{\\comment (endDescTableData) }\n")
+ m_t << "\\cell }{\\row }\n";
}
// a style for list formatted as a "bulleted list"
@@ -2067,65 +2110,65 @@ void RTFGenerator::decrementIndentLevel()
}
// a style for list formatted with "list continue" style
-const char * RTFGenerator::rtf_CList_DepthStyle()
+QCString RTFGenerator::rtf_CList_DepthStyle()
{
QCString n=makeIndexName("ListContinue",m_listLevel);
- return rtf_Style[n]->reference();
+ return rtf_Style[n.str()].reference();
}
// a style for list formatted as a "latext style" table of contents
-const char * RTFGenerator::rtf_LCList_DepthStyle()
+QCString RTFGenerator::rtf_LCList_DepthStyle()
{
QCString n=makeIndexName("LatexTOC",m_listLevel);
- return rtf_Style[n]->reference();
+ return rtf_Style[n.str()].reference();
}
// a style for list formatted as a "bullet" style
-const char * RTFGenerator::rtf_BList_DepthStyle()
+QCString RTFGenerator::rtf_BList_DepthStyle()
{
QCString n=makeIndexName("ListBullet",m_listLevel);
- return rtf_Style[n]->reference();
+ return rtf_Style[n.str()].reference();
}
// a style for list formatted as a "enumeration" style
-const char * RTFGenerator::rtf_EList_DepthStyle()
+QCString RTFGenerator::rtf_EList_DepthStyle()
{
QCString n=makeIndexName("ListEnum",m_listLevel);
- return rtf_Style[n]->reference();
+ return rtf_Style[n.str()].reference();
}
-const char * RTFGenerator::rtf_DList_DepthStyle()
+QCString RTFGenerator::rtf_DList_DepthStyle()
{
QCString n=makeIndexName("DescContinue",m_listLevel);
- return rtf_Style[n]->reference();
+ return rtf_Style[n.str()].reference();
}
-const char * RTFGenerator::rtf_Code_DepthStyle()
+QCString RTFGenerator::rtf_Code_DepthStyle()
{
QCString n=makeIndexName("CodeExample",m_listLevel);
- return rtf_Style[n]->reference();
+ return rtf_Style[n.str()].reference();
}
void RTFGenerator::startTextBlock(bool dense)
{
- DBG_RTF(t << "{\\comment startTextBlock}" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset;
+ DBG_RTF(m_t << "{\\comment startTextBlock}\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset;
if (dense) // no spacing between "paragraphs"
{
- t << rtf_Style["DenseText"]->reference();
+ m_t << rtf_Style["DenseText"].reference();
}
else // some spacing
{
- t << rtf_Style["BodyText"]->reference();
+ m_t << rtf_Style["BodyText"].reference();
}
}
void RTFGenerator::endTextBlock(bool /*paraBreak*/)
{
newParagraph();
- DBG_RTF(t << "{\\comment endTextBlock}" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment endTextBlock}\n")
+ m_t << "}\n";
//m_omitParagraph = TRUE;
}
@@ -2133,58 +2176,58 @@ void RTFGenerator::newParagraph()
{
if (!m_omitParagraph)
{
- DBG_RTF(t << "{\\comment (newParagraph)}" << endl)
- t << "\\par" << endl;
+ DBG_RTF(m_t << "{\\comment (newParagraph)}\n")
+ m_t << "\\par\n";
}
m_omitParagraph = FALSE;
}
-void RTFGenerator::startParagraph(const char *txt)
+void RTFGenerator::startParagraph(const QCString &txt)
{
- DBG_RTF(t << "{\\comment startParagraph}" << endl)
+ DBG_RTF(m_t << "{\\comment startParagraph}\n")
newParagraph();
- t << "{" << endl;
- if (QCString(txt) == "reference") t << "\\ql" << endl;
+ m_t << "{\n";
+ if (QCString(txt) == "reference") m_t << "\\ql\n";
}
void RTFGenerator::endParagraph()
{
- DBG_RTF(t << "{\\comment endParagraph}" << endl)
- t << "}\\par" << endl;
+ DBG_RTF(m_t << "{\\comment endParagraph}\n")
+ m_t << "}\\par\n";
m_omitParagraph = TRUE;
}
void RTFGenerator::startMemberSubtitle()
{
- DBG_RTF(t << "{\\comment startMemberSubtitle}" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_CList_DepthStyle() << endl;
+ DBG_RTF(m_t << "{\\comment startMemberSubtitle}\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_CList_DepthStyle() << "\n";
}
void RTFGenerator::endMemberSubtitle()
{
- DBG_RTF(t << "{\\comment endMemberSubtitle}" << endl)
+ DBG_RTF(m_t << "{\\comment endMemberSubtitle}\n")
newParagraph();
- t << "}" << endl;
+ m_t << "}\n";
}
//void RTFGenerator::writeUmlaut(char c)
//{
// switch(c)
// {
-// case 'A' : t << '\304'; break;
-// case 'E' : t << '\313'; break;
-// case 'I' : t << '\317'; break;
-// case 'O' : t << '\326'; break;
-// case 'U' : t << '\334'; break;
-// case 'Y' : t << 'Y'; break;
-// case 'a' : t << '\344'; break;
-// case 'e' : t << '\353'; break;
-// case 'i' : t << '\357'; break;
-// case 'o' : t << '\366'; break;
-// case 'u' : t << '\374'; break;
-// case 'y' : t << '\377'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\304'; break;
+// case 'E' : m_t << '\313'; break;
+// case 'I' : m_t << '\317'; break;
+// case 'O' : m_t << '\326'; break;
+// case 'U' : m_t << '\334'; break;
+// case 'Y' : m_t << 'Y'; break;
+// case 'a' : m_t << '\344'; break;
+// case 'e' : m_t << '\353'; break;
+// case 'i' : m_t << '\357'; break;
+// case 'o' : m_t << '\366'; break;
+// case 'u' : m_t << '\374'; break;
+// case 'y' : m_t << '\377'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2192,19 +2235,19 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'A' : t << '\301'; break;
-// case 'E' : t << '\311'; break;
-// case 'I' : t << '\315'; break;
-// case 'O' : t << '\323'; break;
-// case 'U' : t << '\332'; break;
-// case 'Y' : t << '\335'; break;
-// case 'a' : t << '\341'; break;
-// case 'e' : t << '\351'; break;
-// case 'i' : t << '\355'; break;
-// case 'o' : t << '\363'; break;
-// case 'u' : t << '\372'; break;
-// case 'y' : t << '\375'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\301'; break;
+// case 'E' : m_t << '\311'; break;
+// case 'I' : m_t << '\315'; break;
+// case 'O' : m_t << '\323'; break;
+// case 'U' : m_t << '\332'; break;
+// case 'Y' : m_t << '\335'; break;
+// case 'a' : m_t << '\341'; break;
+// case 'e' : m_t << '\351'; break;
+// case 'i' : m_t << '\355'; break;
+// case 'o' : m_t << '\363'; break;
+// case 'u' : m_t << '\372'; break;
+// case 'y' : m_t << '\375'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2212,17 +2255,17 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'A' : t << '\300'; break;
-// case 'E' : t << '\310'; break;
-// case 'I' : t << '\314'; break;
-// case 'O' : t << '\322'; break;
-// case 'U' : t << '\331'; break;
-// case 'a' : t << '\340'; break;
-// case 'e' : t << '\350'; break;
-// case 'i' : t << '\354'; break;
-// case 'o' : t << '\362'; break;
-// case 'u' : t << '\371'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\300'; break;
+// case 'E' : m_t << '\310'; break;
+// case 'I' : m_t << '\314'; break;
+// case 'O' : m_t << '\322'; break;
+// case 'U' : m_t << '\331'; break;
+// case 'a' : m_t << '\340'; break;
+// case 'e' : m_t << '\350'; break;
+// case 'i' : m_t << '\354'; break;
+// case 'o' : m_t << '\362'; break;
+// case 'u' : m_t << '\371'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2230,17 +2273,17 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'A' : t << '\302'; break;
-// case 'E' : t << '\312'; break;
-// case 'I' : t << '\316'; break;
-// case 'O' : t << '\324'; break;
-// case 'U' : t << '\333'; break;
-// case 'a' : t << '\342'; break;
-// case 'e' : t << '\352'; break;
-// case 'i' : t << '\356'; break;
-// case 'o' : t << '\364'; break;
-// case 'u' : t << '\373'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\302'; break;
+// case 'E' : m_t << '\312'; break;
+// case 'I' : m_t << '\316'; break;
+// case 'O' : m_t << '\324'; break;
+// case 'U' : m_t << '\333'; break;
+// case 'a' : m_t << '\342'; break;
+// case 'e' : m_t << '\352'; break;
+// case 'i' : m_t << '\356'; break;
+// case 'o' : m_t << '\364'; break;
+// case 'u' : m_t << '\373'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2248,13 +2291,13 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'A' : t << '\303'; break;
-// case 'N' : t << '\321'; break;
-// case 'O' : t << '\325'; break;
-// case 'a' : t << '\343'; break;
-// case 'n' : t << '\361'; break;
-// case 'o' : t << '\365'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\303'; break;
+// case 'N' : m_t << '\321'; break;
+// case 'O' : m_t << '\325'; break;
+// case 'a' : m_t << '\343'; break;
+// case 'n' : m_t << '\361'; break;
+// case 'o' : m_t << '\365'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2262,9 +2305,9 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'A' : t << '\305'; break;
-// case 'a' : t << '\345'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\305'; break;
+// case 'a' : m_t << '\345'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2272,9 +2315,9 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'C' : t << '\307'; break;
-// case 'c' : t << '\347'; break;
-// default: t << '?'; break;
+// case 'C' : m_t << '\307'; break;
+// case 'c' : m_t << '\347'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2311,25 +2354,25 @@ bool isLeadBytes(int c)
// note: function is not reentrant!
-static void encodeForOutput(FTextStream &t,const char *s)
+static void encodeForOutput(TextStream &t,const QCString &s)
{
if (s==0) return;
QCString encoding;
bool converted=FALSE;
- int l = qstrlen(s);
- static QByteArray enc;
+ int l = (int)s.length();
+ static std::vector<char> enc;
if (l*4>(int)enc.size()) enc.resize(l*4); // worst case
- encoding.sprintf("CP%s",theTranslator->trRTFansicp().data());
+ encoding.sprintf("CP%s",qPrint(theTranslator->trRTFansicp()));
if (!encoding.isEmpty())
{
// convert from UTF-8 back to the output encoding
- void *cd = portable_iconv_open(encoding,"UTF-8");
+ void *cd = portable_iconv_open(encoding.data(),"UTF-8");
if (cd!=(void *)(-1))
{
size_t iLeft=l;
size_t oLeft=enc.size();
- char *inputPtr = (char*)s;
- char *outputPtr = enc.data();
+ const char *inputPtr = s.data();
+ char *outputPtr = &enc[0];
if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft))
{
enc.resize(enc.size()-(unsigned int)oLeft);
@@ -2340,7 +2383,7 @@ static void encodeForOutput(FTextStream &t,const char *s)
}
if (!converted) // if we did not convert anything, copy as is.
{
- memcpy(enc.data(),s,l);
+ memcpy(enc.data(),s.data(),l);
enc.resize(l);
}
uint i;
@@ -2376,13 +2419,13 @@ static void encodeForOutput(FTextStream &t,const char *s)
* VERY brittle routine inline RTF's included by other RTF's.
* it is recursive and ugly.
*/
-static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncludeHeader=TRUE)
+static bool preProcessFile(Dir &d,const QCString &infName, TextStream &t, bool bIncludeHeader=TRUE)
{
- QFile f(infName);
- if (!f.open(IO_ReadOnly))
+ std::ifstream f(infName.str(),std::ifstream::in);
+ if (!f.is_open())
{
err("problems opening rtf file %s for reading\n",infName.data());
- return FALSE;
+ return false;
}
const int maxLineLength = 10240;
@@ -2392,67 +2435,59 @@ static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncl
// this is EXTREEEEEEEMLY brittle. It works on OUR rtf
// files because the first line before the body
// ALWAYS contains "{\comment begin body}"
- int len;
- for(;;)
+ std::string line;
+ while (getline(f,line))
{
- lineBuf.resize(maxLineLength);
- if ((len=f.readLine(lineBuf.rawData(),maxLineLength))==-1)
- {
- err("read error in %s before end of RTF header!\n",infName.data());
- return FALSE;
- }
- lineBuf.resize(len+1);
- if (lineBuf.find("\\comment begin body")!=-1) break;
- if (bIncludeHeader) encodeForOutput(t,lineBuf.data());
+ line+='\n';
+ if (line.find("\\comment begin body")!=std::string::npos) break;
+ if (bIncludeHeader) encodeForOutput(t,line.c_str());
}
-
- lineBuf.resize(maxLineLength);
- while ((len=f.readLine(lineBuf.rawData(),maxLineLength))!=-1)
+ std::string prevLine;
+ bool first=true;
+ while (getline(f,line))
{
- lineBuf.resize(len+1);
- int pos;
- if ((pos=lineBuf.find("INCLUDETEXT"))!=-1)
+ line+='\n';
+ size_t pos;
+ if ((pos=prevLine.find("INCLUDETEXT"))!=std::string::npos)
{
- int startNamePos = lineBuf.find('"',pos)+1;
- int endNamePos = lineBuf.find('"',startNamePos);
- QCString fileName = lineBuf.mid(startNamePos,endNamePos-startNamePos);
- DBG_RTF(t << "{\\comment begin include " << fileName << "}" << endl)
- if (!preProcessFile(d,fileName,t,FALSE)) return FALSE;
- DBG_RTF(t << "{\\comment end include " << fileName << "}" << endl)
+ size_t startNamePos = prevLine.find('"',pos)+1;
+ size_t endNamePos = prevLine.find('"',startNamePos);
+ std::string fileName = prevLine.substr(startNamePos,endNamePos-startNamePos);
+ DBG_RTF(m_t << "{\\comment begin include " << fileName << "}\n")
+ if (!preProcessFile(d,fileName.c_str(),t,FALSE)) return FALSE;
+ DBG_RTF(m_t << "{\\comment end include " << fileName << "}\n")
}
- else // no INCLUDETEXT on this line
+ else if (!first) // no INCLUDETEXT on this line
{
- // elaborate hoopla to skip the final "}" if we didn't include the
- // headers
- if (!f.atEnd() || bIncludeHeader)
- {
- encodeForOutput(t,lineBuf);
- }
- else // last line of included file
- {
- // null terminate at the last '}'
- //char *str = strrchr(buffer,'}');
- pos = lineBuf.findRev('}');
-
- if (pos != -1)
- lineBuf.at(pos) = '\0';
- else
- err("Strange, the last char was not a '}'\n");
- encodeForOutput(t,lineBuf);
- }
+ encodeForOutput(t,prevLine.c_str());
}
- lineBuf.resize(maxLineLength);
+ prevLine = line;
+ first=false;
+ }
+ if (!bIncludeHeader) // skip final '}' in case we don't include headers
+ {
+ size_t pos = line.rfind('}');
+ if (pos==std::string::npos)
+ {
+ err("Strange, the last char was not a '}'\n");
+ pos = line.length();
+ }
+ encodeForOutput(t,line.substr(0,pos).c_str());
+ }
+ else
+ {
+ encodeForOutput(t,line.c_str());
}
f.close();
// remove temporary file
- d.remove(infName);
+ d.remove(infName.str());
return TRUE;
}
void RTFGenerator::startDotGraph()
{
- DBG_RTF(t << "{\\comment (startDotGraph)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startDotGraph)}\n")
}
void RTFGenerator::endDotGraph(DotClassGraph &g)
@@ -2460,40 +2495,40 @@ void RTFGenerator::endDotGraph(DotClassGraph &g)
newParagraph();
QCString fn =
- g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,TRUE,FALSE);
+ g.writeGraph(m_t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,TRUE,FALSE);
// display the file
- t << "{" << endl;
- t << rtf_Style_Reset << endl;
- t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
QCString imgExt = getDotImageExtension();
- t << fn << "." << imgExt;
- t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
- t << "}" << endl;
+ m_t << fn << "." << imgExt;
+ m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+ m_t << "}\n";
newParagraph();
- DBG_RTF(t << "{\\comment (endDotGraph)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endDotGraph)}\n")
}
void RTFGenerator::startInclDepGraph()
{
- DBG_RTF(t << "{\\comment (startInclDepGraph)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startInclDepGraph)}\n")
}
void RTFGenerator::endInclDepGraph(DotInclDepGraph &g)
{
newParagraph();
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
+ QCString fn = g.writeGraph(m_t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
// display the file
- t << "{" << endl;
- t << rtf_Style_Reset << endl;
- t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
QCString imgExt = getDotImageExtension();
- t << fn << "." << imgExt;
- t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
- t << "}" << endl;
- DBG_RTF(t << "{\\comment (endInclDepGraph)}" << endl)
+ m_t << fn << "." << imgExt;
+ m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+ m_t << "}\n";
+ DBG_RTF(m_t << "{\\comment (endInclDepGraph)}\n")
}
void RTFGenerator::startGroupCollaboration()
@@ -2506,64 +2541,64 @@ void RTFGenerator::endGroupCollaboration(DotGroupCollaboration &)
void RTFGenerator::startCallGraph()
{
- DBG_RTF(t << "{\\comment (startCallGraph)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startCallGraph)}\n")
}
void RTFGenerator::endCallGraph(DotCallGraph &g)
{
newParagraph();
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
+ QCString fn = g.writeGraph(m_t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
// display the file
- t << "{" << endl;
- t << rtf_Style_Reset << endl;
- t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
QCString imgExt = getDotImageExtension();
- t << fn << "." << imgExt;
- t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
- t << "}" << endl;
- DBG_RTF(t << "{\\comment (endCallGraph)}" << endl)
+ m_t << fn << "." << imgExt;
+ m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+ m_t << "}\n";
+ DBG_RTF(m_t << "{\\comment (endCallGraph)}\n")
}
void RTFGenerator::startDirDepGraph()
{
- DBG_RTF(t << "{\\comment (startDirDepGraph)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startDirDepGraph)}\n")
}
void RTFGenerator::endDirDepGraph(DotDirDeps &g)
{
newParagraph();
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
+ QCString fn = g.writeGraph(m_t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
// display the file
- t << "{" << endl;
- t << rtf_Style_Reset << endl;
- t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
QCString imgExt = getDotImageExtension();
- t << fn << "." << imgExt;
- t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
- t << "}" << endl;
- DBG_RTF(t << "{\\comment (endDirDepGraph)}" << endl)
+ m_t << fn << "." << imgExt;
+ m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+ m_t << "}\n";
+ DBG_RTF(m_t << "{\\comment (endDirDepGraph)}\n")
}
/** Tests the integrity of the result by counting brackets.
*
*/
-void testRTFOutput(const char *name)
+void testRTFOutput(const QCString &name)
{
int bcount=0;
int line=1;
int c;
- QFile f(name);
- if (f.open(IO_ReadOnly))
+ std::ifstream f(name.data(),std::ifstream::in);
+ if (f.is_open())
{
- while ((c=f.getch())!=-1)
+ while ((c=f.get())!=-1)
{
if (c=='\\') // escape char
{
- c=f.getch();
+ c=f.get();
if (c==-1) break;
}
else if (c=='{') // open bracket
@@ -2589,178 +2624,184 @@ void testRTFOutput(const char *name)
err:
err("RTF integrity test failed at line %d of %s due to a bracket mismatch.\n"
" Please try to create a small code example that produces this error \n"
- " and send that to doxygen@gmail.com.\n",line,name);
+ " and send that to doxygen@gmail.com.\n",line,qPrint(name));
}
/**
* This is an API to a VERY brittle RTF preprocessor that combines nested
* RTF files. This version replaces the infile with the new file
*/
-bool RTFGenerator::preProcessFileInplace(const char *path,const char *name)
+bool RTFGenerator::preProcessFileInplace(const QCString &path,const QCString &name)
{
- QDir d(path);
+ Dir d(path.str());
// store the original directory
if (!d.exists())
{
- err("Output dir %s does not exist!\n",path);
+ err("Output dir %s does not exist!\n",qPrint(path));
return FALSE;
}
- QCString oldDir = QDir::currentDirPath().utf8();
+ std::string oldDir = Dir::currentDirPath();
// go to the html output directory (i.e. path)
- QDir::setCurrent(d.absPath());
- QDir thisDir;
+ Dir::setCurrent(d.absPath());
+ Dir thisDir;
- QCString combinedName = (QCString)path+"/combined.rtf";
- QCString mainRTFName = (QCString)path+"/"+name;
+ QCString combinedName = path+"/combined.rtf";
+ QCString mainRTFName = path+"/"+name;
- QFile outf(combinedName);
- if (!outf.open(IO_WriteOnly))
+ std::ofstream f(combinedName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
err("Failed to open %s for writing!\n",combinedName.data());
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return FALSE;
}
- FTextStream outt(&outf);
+ TextStream outt(&f);
if (!preProcessFile(thisDir,mainRTFName,outt))
{
// it failed, remove the temp file
- outf.close();
- thisDir.remove(combinedName);
- QDir::setCurrent(oldDir);
+ outt.flush();
+ f.close();
+ thisDir.remove(combinedName.str());
+ Dir::setCurrent(oldDir);
return FALSE;
}
// everything worked, move the files
- outf.close();
- thisDir.remove(mainRTFName);
- thisDir.rename(combinedName,mainRTFName);
+ outt.flush();
+ f.close();
+ thisDir.remove(mainRTFName.str());
+ thisDir.rename(combinedName.str(),mainRTFName.str());
testRTFOutput(mainRTFName);
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return TRUE;
}
void RTFGenerator::startMemberGroupHeader(bool hasHeader)
{
- DBG_RTF(t << "{\\comment startMemberGroupHeader}" << endl)
- t << "{" << endl;
+ DBG_RTF(m_t << "{\\comment startMemberGroupHeader}\n")
+ m_t << "{\n";
if (hasHeader) incrementIndentLevel();
- t << rtf_Style_Reset << rtf_Style["GroupHeader"]->reference();
+ m_t << rtf_Style_Reset << rtf_Style["GroupHeader"].reference();
}
void RTFGenerator::endMemberGroupHeader()
{
- DBG_RTF(t << "{\\comment endMemberGroupHeader}" << endl)
+ DBG_RTF(m_t << "{\\comment endMemberGroupHeader}\n")
newParagraph();
- t << rtf_Style_Reset << rtf_CList_DepthStyle();
+ m_t << rtf_Style_Reset << rtf_CList_DepthStyle();
}
void RTFGenerator::startMemberGroupDocs()
{
- DBG_RTF(t << "{\\comment startMemberGroupDocs}" << endl)
+ DBG_RTF(m_t << "{\\comment startMemberGroupDocs}\n")
startEmphasis();
}
void RTFGenerator::endMemberGroupDocs()
{
- DBG_RTF(t << "{\\comment endMemberGroupDocs}" << endl)
+ DBG_RTF(m_t << "{\\comment endMemberGroupDocs}\n")
endEmphasis();
newParagraph();
}
void RTFGenerator::startMemberGroup()
{
- DBG_RTF(t << "{\\comment startMemberGroup}" << endl)
- t << rtf_Style_Reset << rtf_BList_DepthStyle() << endl;
+ DBG_RTF(m_t << "{\\comment startMemberGroup}\n")
+ m_t << rtf_Style_Reset << rtf_BList_DepthStyle() << "\n";
}
void RTFGenerator::endMemberGroup(bool hasHeader)
{
- DBG_RTF(t << "{\\comment endMemberGroup}" << endl)
+ DBG_RTF(m_t << "{\\comment endMemberGroup}\n")
if (hasHeader) decrementIndentLevel();
- t << "}";
+ m_t << "}";
}
void RTFGenerator::startExamples()
{
- DBG_RTF(t << "{\\comment (startExamples)}" << endl)
- t << "{"; // ends at endDescList
- t << "{"; // ends at endDescTitle
+ DBG_RTF(m_t << "{\\comment (startExamples)}\n")
+ m_t << "{"; // ends at endDescList
+ m_t << "{"; // ends at endDescTitle
startBold();
newParagraph();
docify(theTranslator->trExamples());
endBold();
- t << "}";
+ m_t << "}";
newParagraph();
incrementIndentLevel();
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
}
void RTFGenerator::endExamples()
{
- DBG_RTF(t << "{\\comment (endExamples)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endExamples)}\n")
m_omitParagraph = FALSE;
newParagraph();
decrementIndentLevel();
m_omitParagraph = TRUE;
- t << "}";
+ m_t << "}";
}
-void RTFGenerator::startParamList(ParamListTypes,const char *title)
+void RTFGenerator::startParamList(ParamListTypes,const QCString &title)
{
- DBG_RTF(t << "{\\comment (startParamList)}" << endl)
- t << "{"; // ends at endParamList
- t << "{"; // ends at endDescTitle
+ DBG_RTF(m_t << "{\\comment (startParamList)}\n")
+ m_t << "{"; // ends at endParamList
+ m_t << "{"; // ends at endDescTitle
startBold();
newParagraph();
docify(title);
endBold();
- t << "}";
+ m_t << "}";
newParagraph();
incrementIndentLevel();
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
}
void RTFGenerator::endParamList()
{
- DBG_RTF(t << "{\\comment (endParamList)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endParamList)}\n")
newParagraph();
decrementIndentLevel();
m_omitParagraph = TRUE;
- t << "}";
+ m_t << "}";
}
-void RTFGenerator::startParameterType(bool first,const char *key)
+void RTFGenerator::startParameterType(bool first,const QCString &key)
{
- DBG_RTF(t << "{\\comment (startParameterType)}" << endl)
- if (!first && key)
+ DBG_RTF(m_t << "{\\comment (startParameterType)}\n")
+ if (!first && !key.isEmpty())
{
- t << " " << key << " ";
+ m_t << " " << key << " ";
}
}
void RTFGenerator::endParameterType()
{
- DBG_RTF(t << "{\\comment (endParameterType)}" << endl)
- t << " ";
+ DBG_RTF(m_t << "{\\comment (endParameterType)}\n")
+ m_t << " ";
}
-void RTFGenerator::exceptionEntry(const char* prefix,bool closeBracket)
+void RTFGenerator::exceptionEntry(const QCString &prefix,bool closeBracket)
{
- DBG_RTF(t << "{\\comment (exceptionEntry)}" << endl)
- if (prefix)
- t << " " << prefix << "(";
+ DBG_RTF(m_t << "{\\comment (exceptionEntry)}\n")
+ if (!prefix.isEmpty())
+ {
+ m_t << " " << prefix << "(";
+ }
else if (closeBracket)
- t << ")";
- t << " ";
+ {
+ m_t << ")";
+ }
+ m_t << " ";
}
void RTFGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *,int)
{
- RTFDocVisitor *visitor = new RTFDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""));
+ RTFDocVisitor *visitor = new RTFDocVisitor(m_t,*this,ctx?ctx->getDefFileExtension():QCString(""));
n->accept(visitor);
delete visitor;
m_omitParagraph = TRUE;
@@ -2768,26 +2809,26 @@ void RTFGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *,i
void RTFGenerator::rtfwriteRuler_doubleline()
{
- DBG_RTF(t << "{\\comment (rtfwriteRuler_doubleline)}" << endl)
- t << "{\\pard\\widctlpar\\brdrb\\brdrdb\\brdrw15\\brsp20 \\adjustright \\par}" << endl;
+ DBG_RTF(m_t << "{\\comment (rtfwriteRuler_doubleline)}\n")
+ m_t << "{\\pard\\widctlpar\\brdrb\\brdrdb\\brdrw15\\brsp20 \\adjustright \\par}\n";
}
void RTFGenerator::rtfwriteRuler_emboss()
{
- DBG_RTF(t << "{\\comment (rtfwriteRuler_emboss)}" << endl)
- t << "{\\pard\\widctlpar\\brdrb\\brdremboss\\brdrw15\\brsp20 \\adjustright \\par}" << endl;
+ DBG_RTF(m_t << "{\\comment (rtfwriteRuler_emboss)}\n")
+ m_t << "{\\pard\\widctlpar\\brdrb\\brdremboss\\brdrw15\\brsp20 \\adjustright \\par}\n";
}
void RTFGenerator::rtfwriteRuler_thick()
{
- DBG_RTF(t << "{\\comment (rtfwriteRuler_thick)}" << endl)
- t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw75\\brsp20 \\adjustright \\par}" << endl;
+ DBG_RTF(m_t << "{\\comment (rtfwriteRuler_thick)}\n")
+ m_t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw75\\brsp20 \\adjustright \\par}\n";
}
void RTFGenerator::rtfwriteRuler_thin()
{
- DBG_RTF(t << "{\\comment (rtfwriteRuler_thin)}" << endl)
- t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}" << endl;
+ DBG_RTF(m_t << "{\\comment (rtfwriteRuler_thin)}\n")
+ m_t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}\n";
}
#if 0
@@ -2821,116 +2862,116 @@ void RTFGenerator::postProcess(QByteArray &a)
}
#endif
-void RTFGenerator::startConstraintList(const char *header)
+void RTFGenerator::startConstraintList(const QCString &header)
{
- DBG_RTF(t << "{\\comment (startConstraintList)}" << endl)
- t << "{"; // ends at endConstraintList
- t << "{";
+ DBG_RTF(m_t << "{\\comment (startConstraintList)}\n")
+ m_t << "{"; // ends at endConstraintList
+ m_t << "{";
startBold();
newParagraph();
docify(header);
endBold();
- t << "}";
+ m_t << "}";
newParagraph();
incrementIndentLevel();
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
}
void RTFGenerator::startConstraintParam()
{
- DBG_RTF(t << "{\\comment (startConstraintParam)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startConstraintParam)}\n")
startEmphasis();
}
void RTFGenerator::endConstraintParam()
{
- DBG_RTF(t << "{\\comment (endConstraintParam)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endConstraintParam)}\n")
endEmphasis();
- t << " : ";
+ m_t << " : ";
}
void RTFGenerator::startConstraintType()
{
- DBG_RTF(t << "{\\comment (startConstraintType)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startConstraintType)}\n")
startEmphasis();
}
void RTFGenerator::endConstraintType()
{
- DBG_RTF(t << "{\\comment (endConstraintType)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endConstraintType)}\n")
endEmphasis();
- t << " ";
+ m_t << " ";
}
void RTFGenerator::startConstraintDocs()
{
- DBG_RTF(t << "{\\comment (startConstraintDocs)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startConstraintDocs)}\n")
}
void RTFGenerator::endConstraintDocs()
{
- DBG_RTF(t << "{\\comment (endConstraintDocs)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endConstraintDocs)}\n")
newParagraph();
}
void RTFGenerator::endConstraintList()
{
- DBG_RTF(t << "{\\comment (endConstraintList)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endConstraintList)}\n")
newParagraph();
decrementIndentLevel();
m_omitParagraph = TRUE;
- t << "}";
+ m_t << "}";
}
void RTFGenerator::startIndexListItem()
{
- DBG_RTF(t << "{\\comment (startIndexListItem)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startIndexListItem)}\n")
}
void RTFGenerator::endIndexListItem()
{
- DBG_RTF(t << "{\\comment (endIndexListItem)}" << endl)
- t << "\\par" << endl;
+ DBG_RTF(m_t << "{\\comment (endIndexListItem)}\n")
+ m_t << "\\par\n";
}
void RTFGenerator::startInlineHeader()
{
- DBG_RTF(t << "{\\comment (startInlineHeader)}" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_Style["Heading5"]->reference();
+ DBG_RTF(m_t << "{\\comment (startInlineHeader)}\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_Style["Heading5"].reference();
startBold();
}
void RTFGenerator::endInlineHeader()
{
- DBG_RTF(t << "{\\comment (endInlineHeader)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endInlineHeader)}\n")
endBold();
- t << "\\par";
- t << "}" << endl;
+ m_t << "\\par";
+ m_t << "}\n";
}
void RTFGenerator::startMemberDocSimple(bool isEnum)
{
- DBG_RTF(t << "{\\comment (startMemberDocSimple)}" << endl)
- t << "{\\par" << endl;
- t << "{" << rtf_Style["Heading5"]->reference() << endl;
+ DBG_RTF(m_t << "{\\comment (startMemberDocSimple)}\n")
+ m_t << "{\\par\n";
+ m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
if (isEnum)
{
- t << theTranslator->trEnumerationValues();
+ m_t << theTranslator->trEnumerationValues();
}
else
{
- t << theTranslator->trCompoundMembers();
+ m_t << theTranslator->trCompoundMembers();
}
- t << ":\\par}" << endl;
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
- t << "\\trowd \\trgaph108\\trleft426\\tblind426"
+ m_t << ":\\par}\n";
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ m_t << "\\trowd \\trgaph108\\trleft426\\tblind426"
"\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrl\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 "
- "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< endl;
+ "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 \n";
int i,n=3,columnPos[3] = { 25, 50, 100 };
if (isEnum)
{
@@ -2940,59 +2981,59 @@ void RTFGenerator::startMemberDocSimple(bool isEnum)
}
for (i=0;i<n;i++)
{
- t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
+ m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 "
"\\cltxlrtb "
- "\\cellx" << (rtf_pageWidth*columnPos[i]/100) << endl;
+ "\\cellx" << (rtf_pageWidth*columnPos[i]/100) << "\n";
}
- t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
+ m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
}
void RTFGenerator::endMemberDocSimple(bool)
{
- DBG_RTF(t << "{\\comment (endMemberDocSimple)}" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment (endMemberDocSimple)}\n")
+ m_t << "}\n";
}
void RTFGenerator::startInlineMemberType()
{
- DBG_RTF(t << "{\\comment (startInlineMemberType)}" << endl)
- t << "{\\qr ";
+ DBG_RTF(m_t << "{\\comment (startInlineMemberType)}\n")
+ m_t << "{\\qr ";
}
void RTFGenerator::endInlineMemberType()
{
- DBG_RTF(t << "{\\comment (endInlineMemberType)}" << endl)
- t << "\\cell }";
+ DBG_RTF(m_t << "{\\comment (endInlineMemberType)}\n")
+ m_t << "\\cell }";
}
void RTFGenerator::startInlineMemberName()
{
- DBG_RTF(t << "{\\comment (startInlineMemberName)}" << endl)
- t << "{";
+ DBG_RTF(m_t << "{\\comment (startInlineMemberName)}\n")
+ m_t << "{";
}
void RTFGenerator::endInlineMemberName()
{
- DBG_RTF(t << "{\\comment (endInlineMemberName)}" << endl)
- t << "\\cell }";
+ DBG_RTF(m_t << "{\\comment (endInlineMemberName)}\n")
+ m_t << "\\cell }";
}
void RTFGenerator::startInlineMemberDoc()
{
- DBG_RTF(t << "{\\comment (startInlineMemberDoc)}" << endl)
- t << "{";
+ DBG_RTF(m_t << "{\\comment (startInlineMemberDoc)}\n")
+ m_t << "{";
}
void RTFGenerator::endInlineMemberDoc()
{
- DBG_RTF(t << "{\\comment (endInlineMemberDoc)}" << endl)
- t << "\\cell }{\\row }" << endl;
+ DBG_RTF(m_t << "{\\comment (endInlineMemberDoc)}\n")
+ m_t << "\\cell }{\\row }\n";
}
-void RTFGenerator::writeLineNumber(const char *ref,const char *fileName,const char *anchor,int l)
+void RTFGenerator::writeLineNumber(const QCString &ref,const QCString &fileName,const QCString &anchor,int l)
{
bool rtfHyperlinks = Config_getBool(RTF_HYPERLINKS);
@@ -3001,23 +3042,23 @@ void RTFGenerator::writeLineNumber(const char *ref,const char *fileName,const ch
lineNumber.sprintf("%05d",l);
if (m_prettyCode)
{
- if (fileName && !m_sourceFileName.isEmpty() && rtfHyperlinks)
+ if (!fileName.isEmpty() && !m_sourceFileName.isEmpty() && rtfHyperlinks)
{
QCString lineAnchor;
lineAnchor.sprintf("_l%05d",l);
lineAnchor.prepend(stripExtensionGeneral(m_sourceFileName, ".rtf"));
- t << "{\\bkmkstart ";
- t << rtfFormatBmkStr(lineAnchor);
- t << "}";
- t << "{\\bkmkend ";
- t << rtfFormatBmkStr(lineAnchor);
- t << "}" << endl;
+ m_t << "{\\bkmkstart ";
+ m_t << rtfFormatBmkStr(lineAnchor);
+ m_t << "}";
+ m_t << "{\\bkmkend ";
+ m_t << rtfFormatBmkStr(lineAnchor);
+ m_t << "}\n";
}
- t << lineNumber << " ";
+ m_t << lineNumber << " ";
}
else
{
- t << l << " ";
+ m_t << l << " ";
}
m_col=0;
}
@@ -3036,17 +3077,17 @@ void RTFGenerator::startLabels()
{
}
-void RTFGenerator::writeLabel(const char *l,bool isLast)
+void RTFGenerator::writeLabel(const QCString &l,bool isLast)
{
- t << "{\\f2 [" << l << "]}";
- if (!isLast) t << ", ";
+ m_t << "{\\f2 [" << l << "]}";
+ if (!isLast) m_t << ", ";
}
void RTFGenerator::endLabels()
{
}
-void RTFGenerator::startFontClass(const char *name)
+void RTFGenerator::startFontClass(const QCString &name)
{
int cod = 2;
QCString qname(name);
@@ -3061,10 +3102,10 @@ void RTFGenerator::startFontClass(const char *name)
else if (qname == "vhdlchar") cod = 25;
else if (qname == "vhdlkeyword") cod = 26;
else if (qname == "vhdllogic") cod = 27;
- t << "{\\cf" << cod << " ";
+ m_t << "{\\cf" << cod << " ";
}
void RTFGenerator::endFontClass()
{
- t << "}";
+ m_t << "}";
}