diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-15 10:52:33 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-15 10:52:33 +0900 |
commit | 0efe600d6f0659af7bae9047301dd60983e18a6e (patch) | |
tree | 50131a4bf60e38149cccd2a84086c675b8533e9d /src/rtfgen.cpp | |
parent | b3e03c958bd4534210bdb8d87ab0b56ada4562fb (diff) | |
download | doxygen-0efe600d6f0659af7bae9047301dd60983e18a6e.tar.gz doxygen-0efe600d6f0659af7bae9047301dd60983e18a6e.tar.bz2 doxygen-0efe600d6f0659af7bae9047301dd60983e18a6e.zip |
Imported Upstream version 1.8.10upstream/1.8.10
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r-- | src/rtfgen.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 354469b..7baaa3c 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2014 by Parker Waechter & Dimitri van Heesch. + * Copyright (C) 1997-2015 by Parker Waechter & Dimitri van Heesch. * * Style sheet additions by Alexander Bartolich * @@ -95,7 +95,7 @@ RTFGenerator::~RTFGenerator() void RTFGenerator::writeStyleSheetFile(QFile &file) { - QTextStream t(&file); + FTextStream t(&file); t << "# Generated by doxygen " << versionString << "\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"; @@ -112,7 +112,7 @@ void RTFGenerator::writeStyleSheetFile(QFile &file) void RTFGenerator::writeExtensionsFile(QFile &file) { - QTextStream t(&file); + FTextStream t(&file); t << "# Generated by doxygen " << versionString << "\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"; @@ -2362,19 +2362,24 @@ 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; do { - if (f.readLine(lineBuf.data(),maxLineLength)==-1) + 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 (bIncludeHeader) encodeForOutput(t,lineBuf.data()); } while (lineBuf.find("\\comment begin body")==-1); - while (f.readLine(lineBuf.data(),maxLineLength)!=-1) + lineBuf.resize(maxLineLength); + while ((len=f.readLine(lineBuf.rawData(),maxLineLength))!=-1) { + lineBuf.resize(len+1); int pos; if ((pos=lineBuf.find("INCLUDETEXT"))!=-1) { @@ -2406,6 +2411,7 @@ static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncl encodeForOutput(t,lineBuf); } } + lineBuf.resize(maxLineLength); } f.close(); // remove temporary file @@ -2429,7 +2435,8 @@ void RTFGenerator::endDotGraph(const DotClassGraph &g) t << "{" << endl; t << rtf_Style_Reset << endl; t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \""; - t << fn << "." << Config_getEnum("DOT_IMAGE_FORMAT"); + QCString imgExt = getDotImageExtension(); + t << fn << "." << imgExt; t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << "}" << endl; newParagraph(); @@ -2452,7 +2459,8 @@ void RTFGenerator::endInclDepGraph(const DotInclDepGraph &g) t << "{" << endl; t << rtf_Style_Reset << endl; t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \""; - t << fn << "." << Config_getEnum("DOT_IMAGE_FORMAT"); + QCString imgExt = getDotImageExtension(); + t << fn << "." << imgExt; t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << "}" << endl; DBG_RTF(t << "{\\comment (endInclDepGraph)}" << endl) @@ -2482,7 +2490,8 @@ void RTFGenerator::endCallGraph(const DotCallGraph &g) t << "{" << endl; t << rtf_Style_Reset << endl; t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \""; - t << fn << "." << Config_getEnum("DOT_IMAGE_FORMAT"); + QCString imgExt = getDotImageExtension(); + t << fn << "." << imgExt; t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << "}" << endl; DBG_RTF(t << "{\\comment (endCallGraph)}" << endl) @@ -2504,7 +2513,8 @@ void RTFGenerator::endDirDepGraph(const DotDirDeps &g) t << "{" << endl; t << rtf_Style_Reset << endl; t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \""; - t << fn << "." << Config_getEnum("DOT_IMAGE_FORMAT"); + QCString imgExt = getDotImageExtension(); + t << fn << "." << imgExt; t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << "}" << endl; DBG_RTF(t << "{\\comment (endDirDepGraph)}" << endl) |