summaryrefslogtreecommitdiffstats
path: root/src/rtfgen.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2007-02-19 18:51:10 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2007-02-19 18:51:10 (GMT)
commitf7f03d9491454ddc9b855b8637d482df6bd622c2 (patch)
treec87efff649bf31ee31966a867e71ba7f159fca43 /src/rtfgen.cpp
parent1c80138e2c47e9c608b56c32b5677fa6a46b4d6f (diff)
downloadDoxygen-f7f03d9491454ddc9b855b8637d482df6bd622c2.zip
Doxygen-f7f03d9491454ddc9b855b8637d482df6bd622c2.tar.gz
Doxygen-f7f03d9491454ddc9b855b8637d482df6bd622c2.tar.bz2
Release-1.5.1-20070219
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r--src/rtfgen.cpp48
1 files changed, 38 insertions, 10 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index 447cbdb..f6fb8af 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2006 by Parker Waechter & Dimitri van Heesch.
+ * Copyright (C) 1997-2007 by Parker Waechter & Dimitri van Heesch.
*
* Style sheet additions by Alexander Bartolich
*
@@ -324,6 +324,7 @@ void RTFGenerator::beginRTFSection()
void RTFGenerator::startFile(const char *name,const char *,const char *)
{
+ setEncoding(QCString().sprintf("CP%s",theTranslator->trRTFansicp().data()));
QCString fileName=name;
relPath = relativePathToRoot(fileName);
@@ -1600,13 +1601,13 @@ void RTFGenerator::endSection(const char *lab,SectionInfo::SectionType)
// writeSectionRef(name,lab,title);
//}
-char* RTFGenerator::getMultiByte(int c)
-{
- static char s[10];
-
- sprintf(s,"\\'%X",c);
- return s;
-}
+//char* RTFGenerator::getMultiByte(int c)
+//{
+// static char s[10];
+//
+// sprintf(s,"\\'%X",c);
+// return s;
+//}
void RTFGenerator::docify(const char *str)
{
@@ -1617,9 +1618,10 @@ void RTFGenerator::docify(const char *str)
unsigned char pc='\0';
while (*p)
{
- static bool MultiByte = FALSE;
+ //static bool MultiByte = FALSE;
c=*p++;
+#if 0
if ( MultiByte )
{
t << getMultiByte( c );
@@ -1632,6 +1634,7 @@ void RTFGenerator::docify(const char *str)
t << getMultiByte( c );
continue;
}
+#endif
switch (c)
{
@@ -1664,10 +1667,11 @@ void RTFGenerator::codify(const char *str)
while (*p)
{
- static bool MultiByte = FALSE;
+ //static bool MultiByte = FALSE;
c=*p++;
+#if 0
if( MultiByte )
{
t << getMultiByte( c );
@@ -1680,6 +1684,7 @@ void RTFGenerator::codify(const char *str)
t << getMultiByte( c );
continue;
}
+#endif
switch(c)
{
@@ -2517,3 +2522,26 @@ void RTFGenerator::rtfwriteRuler_thin()
t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}" << endl;
}
+void RTFGenerator::postProcess(QByteArray &a)
+{
+ QByteArray enc(a.size()*4); // worst case
+ int off=0;
+ uint i;
+ for (i=0;i<a.size();i++)
+ {
+ unsigned char c = (unsigned char)a.at(i);
+ if (c>0x80)
+ {
+ char s[10];
+ sprintf(s,"\\'%X",c);
+ qstrcpy(enc.data()+off,s);
+ off+=qstrlen(s);
+ }
+ else
+ {
+ enc.at(off++)=c;
+ }
+ }
+ enc.resize(off);
+ a = enc;
+}