diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2007-02-19 18:51:10 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2007-02-19 18:51:10 (GMT) |
commit | eb591296685b8268427173e0a24f74abd987170d (patch) | |
tree | c87efff649bf31ee31966a867e71ba7f159fca43 /src/rtfgen.cpp | |
parent | 84dc695cd534be6a58ae71ec7f2bcf3b6b5e9e64 (diff) | |
download | Doxygen-eb591296685b8268427173e0a24f74abd987170d.zip Doxygen-eb591296685b8268427173e0a24f74abd987170d.tar.gz Doxygen-eb591296685b8268427173e0a24f74abd987170d.tar.bz2 |
Release-1.5.1-20070219
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r-- | src/rtfgen.cpp | 48 |
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; +} |