summaryrefslogtreecommitdiffstats
path: root/src/rtfgen.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-06-23 09:46:45 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-06-23 09:46:45 (GMT)
commitc454a5400393a54586d81517c42f7419b43b3f23 (patch)
treec485ad24b61429cd10455b2d438236483a47c189 /src/rtfgen.cpp
parent784e2b65dc675f89c8f21b3c7b306f5fb1bfa4ca (diff)
downloadDoxygen-c454a5400393a54586d81517c42f7419b43b3f23.zip
Doxygen-c454a5400393a54586d81517c42f7419b43b3f23.tar.gz
Doxygen-c454a5400393a54586d81517c42f7419b43b3f23.tar.bz2
Release-1.2.16-20020623
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r--src/rtfgen.cpp86
1 files changed, 65 insertions, 21 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index 1dc2d2b..a6d5a9f 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -502,7 +502,8 @@ bool StyleData::setStyle(const char* s, const char* styleName)
static const QRegExp subgroup("^{[^}]*}\\s*");
static const QRegExp any_clause("^\\\\[a-z][a-z0-9-]*\\s*");
- int len;
+ int len = 0; // length of a particular RTF formatting control
+ int ref_len = 0; // length of the whole formatting section of a style
int start = s_clause.match(s, 0, &len);
if (start < 0)
{
@@ -514,6 +515,7 @@ bool StyleData::setStyle(const char* s, const char* styleName)
// search for the end of pure formatting codes
const char* end = s + len;
+ ref_len = len;
bool haveNewDefinition = TRUE;
for(;;)
{
@@ -523,7 +525,10 @@ bool StyleData::setStyle(const char* s, const char* styleName)
if (0 != subgroup.match(end, 0, &len))
break;
else
+ {
end += len;
+ ref_len += len;
+ }
}
else if (*end == '\\')
{
@@ -534,6 +539,7 @@ bool StyleData::setStyle(const char* s, const char* styleName)
if (0 != any_clause.match(end, 0, &len))
break;
end += len;
+ ref_len += len;
}
else if (*end == 0)
{ // no style-definition part, keep default value
@@ -544,8 +550,9 @@ bool StyleData::setStyle(const char* s, const char* styleName)
break;
}
delete[] reference;
- reference = new char[len + 1];
- memcpy(reference, s, len); reference[len] = 0;
+ reference = new char[ref_len + 1];
+ memcpy(reference, s, ref_len);
+ reference[ref_len] = 0;
if (haveNewDefinition)
{
delete[] definition;
@@ -2047,24 +2054,6 @@ void RTFGenerator::endDescList()
t << "}";
}
-void RTFGenerator::startParamList(ParamListTypes)
-{
- DBG_RTF(t << "{\\comment (startParamList)}" << endl)
- t << "{"; // ends at endParamList
- t << "{"; // ends at endDescTitle
- startBold();
- newParagraph();
-}
-
-void RTFGenerator::endParamList()
-{
- DBG_RTF(t << "{\\comment (endParamList)}" << endl)
- newParagraph();
- decrementIndentLevel();
- m_omitParagraph = TRUE;
- t << "}";
-}
-
void RTFGenerator::startSection(const char *,const char *title,bool sub)
{
@@ -2896,3 +2885,58 @@ void RTFGenerator::endMemberGroup(bool hasHeader)
t << "}";
}
+void RTFGenerator::startSimpleSect(SectionTypes,const char *file,const char *anchor,const char *title)
+{
+ DBG_RTF(t << "{\\comment (startSimpleSect)}" << endl)
+ t << "{"; // ends at endDescList
+ t << "{"; // ends at endDescTitle
+ startBold();
+ newParagraph();
+ if (file)
+ {
+ writeObjectLink(0,file,anchor,title);
+ }
+ else
+ {
+ docify(title);
+ }
+ endBold();
+ t << "}";
+ newParagraph();
+ incrementIndentLevel();
+ t << Rtf_Style_Reset << Rtf_DList_DepthStyle();
+}
+
+void RTFGenerator::endSimpleSect()
+{
+ DBG_RTF(t << "{\\comment (endSimpleSect)}" << endl)
+ newParagraph();
+ decrementIndentLevel();
+ m_omitParagraph = TRUE;
+ t << "}";
+}
+
+void RTFGenerator::startParamList(ParamListTypes,const char *title)
+{
+ DBG_RTF(t << "{\\comment (startParamList)}" << endl)
+ t << "{"; // ends at endParamList
+ t << "{"; // ends at endDescTitle
+ startBold();
+ newParagraph();
+ docify(title);
+ endBold();
+ t << "}";
+ newParagraph();
+ incrementIndentLevel();
+ t << Rtf_Style_Reset << Rtf_DList_DepthStyle();
+}
+
+void RTFGenerator::endParamList()
+{
+ DBG_RTF(t << "{\\comment (endParamList)}" << endl)
+ newParagraph();
+ decrementIndentLevel();
+ m_omitParagraph = TRUE;
+ t << "}";
+}
+