diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2002-04-30 17:51:14 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2002-04-30 17:51:14 (GMT) |
commit | 62d3c6501af58ceb48ce8e56327d07ad69e79374 (patch) | |
tree | a37d75aa0ebe073906cb1a3c2c1506b96409f075 /src/rtfgen.cpp | |
parent | ff31b2f109848ea3e08fb17d5821beb7af879193 (diff) | |
download | Doxygen-62d3c6501af58ceb48ce8e56327d07ad69e79374.zip Doxygen-62d3c6501af58ceb48ce8e56327d07ad69e79374.tar.gz Doxygen-62d3c6501af58ceb48ce8e56327d07ad69e79374.tar.bz2 |
Release-1.2.15-20020430
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r-- | src/rtfgen.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 3d70b3a..d84c54f 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -37,6 +37,9 @@ //#define DBG_RTF(x) x; #define DBG_RTF(x) +// used for table column width calculation +#define PAGEWIDTH 8748 + const int indentLevels = 10; struct ListItemInfo @@ -121,6 +124,7 @@ void RTFGenerator::append(const OutputGenerator *g) //insideTabbing=insideTabbing || ((RTFGenerator *)g)->insideTabbing; m_listLevel=((RTFGenerator *)g)->m_listLevel; m_omitParagraph=((RTFGenerator *)g)->m_omitParagraph; + m_columnNumbers=((RTFGenerator *)g)->m_columnNumbers; //printf("RTFGenerator::append(%s) insideTabbing=%s\n", g->getContents().data(), // insideTabbing ? "TRUE" : "FALSE" ); } @@ -1641,6 +1645,59 @@ void RTFGenerator::endSubsubsection() // t << "}"; //} +void RTFGenerator::startTable(bool,int colNumbers) +{ + m_columnNumbers=colNumbers; + t<<"\\par\n"; +} + +void RTFGenerator::endTable(bool hasCaption) +{ + if (!hasCaption) + t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n"; + t << "\\pard\n" << endl; +} + +void RTFGenerator::startCaption() +{ + 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"<<PAGEWIDTH<<"\\pard \\qc\\nowidctlpar\\widctlpar\\intbl\\adjustright "<<endl; + nextTableColumn(); +} + +void RTFGenerator::endCaption() +{ + endTableColumn(); + endTableRow(); +} + +void RTFGenerator::nextTableRow() +{ + unsigned long columnWidth=PAGEWIDTH/m_columnNumbers; + t<<"\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 \\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 \\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 \\trbrdrv\\brdrs\\brdrw10 "<<endl; + for (int i=1;i<=m_columnNumbers;i++) + { + t<<"\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 \\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb \\cellx"<<i*columnWidth<<endl; + } + t<<"\\pard \\widctlpar\\intbl\\adjustright\n{"; +} + +void RTFGenerator::endTableRow() +{ + t<<"\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n"; +} + +void RTFGenerator::nextTableColumn() +{ + t<<"{ "; +} + +void RTFGenerator::endTableColumn() +{ + t<<" \\cell }"; +} + void RTFGenerator::startTextLink(const char *f,const char *anchor) { if (Config_getBool("RTF_HYPERLINKS")) |